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 files that might contain sensitive data
|
||||||
config.local.*
|
config.local.*
|
||||||
*.credentials
|
*.credentials
|
||||||
|
downloads/
|
||||||
|
|||||||
@@ -226,10 +226,15 @@ echo ""
|
|||||||
echo -e "${BOLD}Starting Installation...${NC}"
|
echo -e "${BOLD}Starting Installation...${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Create temp directory (not in /tmp as it may have noexec)
|
# Create download directory in toolkit folder
|
||||||
TEMP_DIR="/root/acronis-install-$$"
|
DOWNLOAD_DIR="$SCRIPT_DIR/downloads"
|
||||||
mkdir -p "$TEMP_DIR"
|
mkdir -p "$DOWNLOAD_DIR"
|
||||||
cd "$TEMP_DIR" || exit 1
|
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
|
# Download installer
|
||||||
echo "→ Downloading Acronis agent installer..."
|
echo "→ Downloading Acronis agent installer..."
|
||||||
@@ -348,9 +353,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
echo "→ Cleaning up temporary files..."
|
echo "→ Cleaning up installation files..."
|
||||||
cd /
|
cd "$SCRIPT_DIR"
|
||||||
rm -rf "$TEMP_DIR"
|
rm -rf "$INSTALL_DIR"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
press_enter
|
press_enter
|
||||||
|
|||||||
Reference in New Issue
Block a user