Use toolkit downloads folder instead of /tmp or /root
Better approach per user suggestion: - Downloads to: /root/server-toolkit/downloads/acronis-install-YYYYMMDD-HHMMSS/ - Keeps toolkit directory organized - Avoids polluting /root - Avoids /tmp noexec issues - Added downloads/ to .gitignore - Cleanup removes timestamped installation directory after completion Benefits: - All downloads in one place - Easy to find if debugging needed - Cleaner than scattered in /root - Still allows execution (not in /tmp)
This commit is contained in:
@@ -54,3 +54,4 @@ id_ed25519.pub
|
||||
# Config files that might contain sensitive data
|
||||
config.local.*
|
||||
*.credentials
|
||||
downloads/
|
||||
|
||||
@@ -226,10 +226,15 @@ echo ""
|
||||
echo -e "${BOLD}Starting Installation...${NC}"
|
||||
echo ""
|
||||
|
||||
# Create temp directory (not in /tmp as it may have noexec)
|
||||
TEMP_DIR="/root/acronis-install-$$"
|
||||
mkdir -p "$TEMP_DIR"
|
||||
cd "$TEMP_DIR" || exit 1
|
||||
# Create download directory in toolkit folder
|
||||
DOWNLOAD_DIR="$SCRIPT_DIR/downloads"
|
||||
mkdir -p "$DOWNLOAD_DIR"
|
||||
cd "$DOWNLOAD_DIR" || exit 1
|
||||
|
||||
# Use timestamped subdirectory for this installation
|
||||
INSTALL_DIR="$DOWNLOAD_DIR/acronis-install-$(date +%Y%m%d-%H%M%S)"
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
cd "$INSTALL_DIR" || exit 1
|
||||
|
||||
# Download installer
|
||||
echo "→ Downloading Acronis agent installer..."
|
||||
@@ -348,9 +353,9 @@ else
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
echo "→ Cleaning up temporary files..."
|
||||
cd /
|
||||
rm -rf "$TEMP_DIR"
|
||||
echo "→ Cleaning up installation files..."
|
||||
cd "$SCRIPT_DIR"
|
||||
rm -rf "$INSTALL_DIR"
|
||||
|
||||
echo ""
|
||||
press_enter
|
||||
|
||||
Reference in New Issue
Block a user