-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu_exit.sh
74 lines (65 loc) · 2.51 KB
/
menu_exit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# ANSI color codes
BRIGHT_RED="\033[1;31m"
ORANGE="\033[0;33m"
YELLOW="\033[1;33m"
LIGHT_GREEN="\033[1;32m"
CYAN="\033[0;36m"
PURPLE="\033[0;35m"
BOLD="\033[1m"
BRIGHT_BLUE="\033[1;34m"
BRIGHT_MAGENTA="\033[1;35m"
NC="\033[0m" # No color
# Function to set up PG executables and their permissions
setup_pg_executables() {
local executables=(
"/usr/local/bin/pg"
"/usr/local/bin/plexguide"
"/usr/local/bin/pgstable"
"/usr/local/bin/pgbeta"
"/usr/local/bin/pgdev"
"/usr/local/bin/pgfork"
"/usr/local/bin/pgreinstall"
)
for executable in "${executables[@]}"; do
if [[ -L "$executable" ]]; then
sudo chown 1000:1000 "$executable"
sudo chmod 755 "$executable"
else
echo "Warning: $executable not found or not a symlink"
fi
done
}
# Function to update permissions for /pg directory
update_pg_permissions() {
if [[ -d "/pg" ]]; then
sudo chown -R 1000:1000 /pg
sudo find /pg -type d -exec chmod 755 {} +
sudo find /pg -type f -exec chmod 644 {} +
sudo chmod +x /pg/scripts/*.sh /pg/installer/*.sh /pgreinstall/*.sh 2>/dev/null
else
echo "Warning: /pg directory not found"
fi
}
# Main script execution
clear
# Run setup functions
setup_pg_executables
update_pg_permissions
# Display the header
echo -e "${BRIGHT_RED}${BOLD}════════════════════════════════════════════════════════${NC}"
echo -e "${BRIGHT_RED}${BOLD}Visit plexguide.com | github.com/plexguide/PlexGuide.com${NC}"
echo -e "${BRIGHT_RED}${BOLD}════════════════════════════════════════════════════════${NC}"
echo "" # Space for separation
# Display information and commands
echo -e "${BOLD}Commands:${NC}"
echo -e "[${BRIGHT_RED}1${NC}] sudo plexguide | Deploy PlexGuide"
echo -e "[${ORANGE}2${NC}] sudo pg | Deploy PlexGuide"
echo -e "[${LIGHT_GREEN}3${NC}] pgstable | Install Latest Stable Build"
echo -e "[${YELLOW}4${NC}] pgbeta | Install Latest Beta Build"
echo -e "[${BRIGHT_MAGENTA}5${NC}] pgdev | Install Latest Dev Build"
echo -e "[${CYAN}6${NC}] pgfork | Fork PlexGuide"
echo -e "[${BRIGHT_BLUE}7${NC}] pgreinstall | To Reinstall PlexGuide (Helps /w Repairs)"
echo "" # Space before exiting
# Exit the script
exit 0