mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:33:56 -04:00
Update casaos toolkit permissions (#58)
* Remove Docker permissions fix and update menu options Eliminated the 'Fix Docker Permissions' function and related menu entry. Updated menu numbering and adjusted overlay2 and full reset functions to let Docker handle directory structure and permissions automatically. * Update toolkit version in run.sh header Changed the displayed version in the run.sh script header from V0.0.1 to V0.1.0 to reflect the current version.
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# BigBearCasaOS Complete Toolkit - Diagnostics and Fixes
|
# BigBear CasaOS Complete Toolkit - Diagnostics and Fixes
|
||||||
# Run with sudo permissions
|
# Run with sudo permissions
|
||||||
|
#
|
||||||
|
# GitHub: https://github.com/BigBearTechWorld
|
||||||
|
# Community: https://community.bigbeartechworld.com
|
||||||
|
# Support: https://ko-fi.com/bigbeartechworld
|
||||||
|
#
|
||||||
|
|
||||||
# Set text colors
|
# Set text colors
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
@@ -26,7 +31,7 @@ print_header() {
|
|||||||
# Function to display menu
|
# Function to display menu
|
||||||
show_menu() {
|
show_menu() {
|
||||||
clear
|
clear
|
||||||
print_header "BigBearCasaOS Toolkit V0.0.1"
|
print_header "BigBearCasaOS Toolkit V0.1.0"
|
||||||
|
|
||||||
echo "Here are some links:"
|
echo "Here are some links:"
|
||||||
echo "https://community.bigbeartechworld.com"
|
echo "https://community.bigbeartechworld.com"
|
||||||
@@ -38,11 +43,10 @@ show_menu() {
|
|||||||
|
|
||||||
echo "===================="
|
echo "===================="
|
||||||
echo "1. Run Diagnostics - Collect system information and logs for troubleshooting"
|
echo "1. Run Diagnostics - Collect system information and logs for troubleshooting"
|
||||||
echo "2. Fix Docker Permissions - Reset directory permissions and ownership for Docker"
|
echo "2. Fix Docker Overlay2 Issues - Repair storage driver problems and rebuild Docker structure"
|
||||||
echo "3. Fix Docker Overlay2 Issues - Repair storage driver problems and rebuild Docker structure"
|
echo "3. Full System Reset - Clean reinstall of Docker and CasaOS (Backs up existing data from /var/lib/docker)"
|
||||||
echo "4. Full System Reset - Clean reinstall of Docker and CasaOS (Backs up existing data from /var/lib/docker)"
|
echo "4. Exit - Close the toolkit"
|
||||||
echo "5. Exit - Close the toolkit"
|
read -p "Enter your choice (1-4): " choice
|
||||||
read -p "Enter your choice (1-5): " choice
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -84,31 +88,6 @@ run_diagnostics() {
|
|||||||
echo -e "Diagnostic file created: ${YELLOW}casaos_diagnostics_${timestamp}.tar.gz${NC}"
|
echo -e "Diagnostic file created: ${YELLOW}casaos_diagnostics_${timestamp}.tar.gz${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to fix Docker permissions
|
|
||||||
fix_docker_permissions() {
|
|
||||||
echo -e "${YELLOW}Fixing Docker permissions...${NC}"
|
|
||||||
|
|
||||||
# Ensure Docker is running
|
|
||||||
if ! systemctl is-active --quiet docker; then
|
|
||||||
systemctl start docker
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create necessary directories
|
|
||||||
mkdir -p /var/lib/docker/tmp
|
|
||||||
chmod 755 /var/lib/docker/tmp
|
|
||||||
|
|
||||||
# Reset permissions
|
|
||||||
chown -R root:root /var/lib/docker
|
|
||||||
chmod -R 755 /var/lib/docker
|
|
||||||
|
|
||||||
# Clean up and restart
|
|
||||||
docker system prune -f
|
|
||||||
systemctl restart docker
|
|
||||||
systemctl restart casaos
|
|
||||||
|
|
||||||
echo -e "${GREEN}Docker permissions have been reset!${NC}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to fix Overlay2 issues
|
# Function to fix Overlay2 issues
|
||||||
fix_overlay2() {
|
fix_overlay2() {
|
||||||
echo -e "${YELLOW}Fixing Docker overlay2 issues...${NC}"
|
echo -e "${YELLOW}Fixing Docker overlay2 issues...${NC}"
|
||||||
@@ -122,16 +101,8 @@ fix_overlay2() {
|
|||||||
mv /var/lib/docker /var/lib/docker.bak.$(date +%Y%m%d_%H%M%S)
|
mv /var/lib/docker /var/lib/docker.bak.$(date +%Y%m%d_%H%M%S)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create fresh directory structure
|
# Create fresh directory structure - Docker will set proper permissions
|
||||||
mkdir -p /var/lib/docker
|
mkdir -p /var/lib/docker
|
||||||
mkdir -p /var/lib/docker/overlay2
|
|
||||||
mkdir -p /var/lib/docker/overlay2/l
|
|
||||||
mkdir -p /var/lib/docker/tmp
|
|
||||||
|
|
||||||
# Set permissions
|
|
||||||
chown -R root:root /var/lib/docker
|
|
||||||
chmod -R 755 /var/lib/docker
|
|
||||||
chmod 700 /var/lib/docker/overlay2/l
|
|
||||||
|
|
||||||
# Configure Docker daemon
|
# Configure Docker daemon
|
||||||
mkdir -p /etc/docker
|
mkdir -p /etc/docker
|
||||||
@@ -144,7 +115,7 @@ fix_overlay2() {
|
|||||||
}
|
}
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
# Restart services
|
# Restart services - Docker daemon will create proper directory structure
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start docker
|
systemctl start docker
|
||||||
systemctl start casaos
|
systemctl start casaos
|
||||||
@@ -196,18 +167,7 @@ full_reset() {
|
|||||||
}
|
}
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
# Create fresh Docker directory structure
|
# Restart services - Docker daemon will create proper directory structure
|
||||||
mkdir -p /var/lib/docker
|
|
||||||
mkdir -p /var/lib/docker/overlay2
|
|
||||||
mkdir -p /var/lib/docker/overlay2/l
|
|
||||||
mkdir -p /var/lib/docker/tmp
|
|
||||||
|
|
||||||
# Set permissions
|
|
||||||
chown -R root:root /var/lib/docker
|
|
||||||
chmod -R 755 /var/lib/docker
|
|
||||||
chmod 700 /var/lib/docker/overlay2/l
|
|
||||||
|
|
||||||
# Restart services
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start docker
|
systemctl start docker
|
||||||
systemctl start casaos
|
systemctl start casaos
|
||||||
@@ -226,15 +186,12 @@ while true; do
|
|||||||
run_diagnostics
|
run_diagnostics
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
fix_docker_permissions
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
fix_overlay2
|
fix_overlay2
|
||||||
;;
|
;;
|
||||||
4)
|
3)
|
||||||
full_reset
|
full_reset
|
||||||
;;
|
;;
|
||||||
5)
|
4)
|
||||||
echo -e "${GREEN}Exiting...${NC}"
|
echo -e "${GREEN}Exiting...${NC}"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user