mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
feat: Add comprehensive Plex recovery validation script
- Introduced `validate-plex-recovery.sh` for validating Plex database recovery. - Implemented checks for service status, database integrity, web interface accessibility, API functionality, and recent logs. - Added detailed recovery summary and next steps for users. fix: Improve Debian patching script for compatibility - Enhanced `debian-patches.sh` to securely download and execute bootstrap scripts. - Updated package mapping logic and ensured proper permissions for patched files. fix: Update Docker test scripts for better permission handling - Modified `run-docker-tests.sh` to set appropriate permissions on logs directory. - Ensured log files have correct permissions after test runs. fix: Enhance setup scripts for secure installations - Updated `setup.sh` to securely download and execute installation scripts for zoxide and nvm. - Improved error handling for failed downloads. fix: Refine startup script for log directory permissions - Adjusted `startup.sh` to set proper permissions for log directories and files. chore: Revamp update-containers.sh for better error handling and logging - Rewrote `update-containers.sh` to include detailed logging and error handling. - Added validation for Docker image names and improved overall script robustness.
This commit is contained in:
@@ -85,27 +85,27 @@ echo -e "${BLUE}Applying Debian-specific patches...${NC}"
|
||||
map_package() {
|
||||
local ubuntu_pkg="$1"
|
||||
local debian_pkg
|
||||
|
||||
|
||||
# Look for the package in the mapping file
|
||||
if [ -f "$PATCH_DIR/debian-packages.map" ]; then
|
||||
debian_pkg=$(grep -v "^#" "$PATCH_DIR/debian-packages.map" | grep "^$ubuntu_pkg|" | cut -d'|' -f2)
|
||||
fi
|
||||
|
||||
|
||||
# If not found or empty, use the original name
|
||||
if [ -z "$debian_pkg" ]; then
|
||||
debian_pkg="$ubuntu_pkg"
|
||||
fi
|
||||
|
||||
|
||||
echo "$debian_pkg"
|
||||
}
|
||||
|
||||
# Patch the packages.list file if it exists
|
||||
if [ -f "$HOME/shell/setup/packages.list" ]; then
|
||||
echo -e "${YELLOW}Patching packages.list for Debian compatibility...${NC}"
|
||||
|
||||
|
||||
# Create a temporary patched file
|
||||
temp_file=$(mktemp)
|
||||
|
||||
|
||||
# Process each line
|
||||
while IFS= read -r line; do
|
||||
# Skip comments and empty lines
|
||||
@@ -113,17 +113,17 @@ if [ -f "$HOME/shell/setup/packages.list" ]; then
|
||||
echo "$line" >> "$temp_file"
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
# Map the package name
|
||||
debian_pkg=$(map_package "$line")
|
||||
echo "$debian_pkg" >> "$temp_file"
|
||||
|
||||
|
||||
done < "$HOME/shell/setup/packages.list"
|
||||
|
||||
|
||||
# Backup original and replace with patched version
|
||||
cp "$HOME/shell/setup/packages.list" "$HOME/shell/setup/packages.list.orig"
|
||||
mv "$temp_file" "$HOME/shell/setup/packages.list"
|
||||
|
||||
|
||||
echo -e "${GREEN}Patched packages.list for Debian compatibility${NC}"
|
||||
fi
|
||||
|
||||
@@ -135,10 +135,10 @@ if ! grep -q "contrib" /etc/apt/sources.list; then
|
||||
echo -e "${YELLOW}Adding contrib and non-free repositories...${NC}"
|
||||
# Create a backup of the original sources.list
|
||||
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
|
||||
|
||||
|
||||
# Add contrib and non-free to each deb line
|
||||
sudo sed -i 's/main$/main contrib non-free non-free-firmware/g' /etc/apt/sources.list
|
||||
|
||||
|
||||
echo -e "${GREEN}Added contrib and non-free repositories${NC}"
|
||||
fi
|
||||
|
||||
@@ -171,9 +171,17 @@ if [ -x "$PATCH_DIR/apply-debian-patches.sh" ]; then
|
||||
"$PATCH_DIR/apply-debian-patches.sh"
|
||||
fi
|
||||
|
||||
# Download and run the bootstrap script
|
||||
# Download and run the bootstrap script securely
|
||||
echo -e "${BLUE}Running bootstrap script...${NC}"
|
||||
curl -s https://raw.githubusercontent.com/acedanger/shell/main/bootstrap.sh | bash
|
||||
TEMP_BOOTSTRAP=$(mktemp)
|
||||
if curl -s https://raw.githubusercontent.com/acedanger/shell/main/bootstrap.sh -o "$TEMP_BOOTSTRAP"; then
|
||||
echo -e "${BLUE}Bootstrap script downloaded, executing...${NC}"
|
||||
bash "$TEMP_BOOTSTRAP"
|
||||
rm -f "$TEMP_BOOTSTRAP"
|
||||
else
|
||||
echo -e "${RED}ERROR: Failed to download bootstrap script${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Apply patches again after bootstrap (in case packages.list was just downloaded)
|
||||
if [ -x "$PATCH_DIR/apply-debian-patches.sh" ]; then
|
||||
|
||||
Reference in New Issue
Block a user