|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | | -VERSION=2.2.1 |
| 3 | +VERSION=2.2.2 |
4 | 4 |
|
5 | 5 | CONFIGVARS=${CONFIGS}/Docker/.config |
6 | 6 | sudo mkdir -p ${CONFIGVARS} |
|
15 | 15 |
|
16 | 16 | echo "${LYELLOW}Upgrading to v${VERSION}... just a moment${STD}"; echo; sleep 2 |
17 | 17 |
|
18 | | - # Check if necessary apps are installed |
19 | | - |
20 | | - if [ ! -e ${CONFIGVARS}/proxyversion ]; then |
21 | | - sudo apt-get update |
22 | | - APPLIST="acl apt-transport-https ca-certificates curl fuse git gpg-agent grsync jq mergerfs nano pigz rsyncufw socat sqlite3 ufw unzip wget" |
23 | | - for i in ${APPLIST}; do |
24 | | - echo Checking $i... |
25 | | - sudo apt-get -y install $i |
26 | | - echo |
27 | | - done |
28 | | - fi |
29 | | - |
30 | | - # Move and rename folders |
31 | | - |
32 | | - if [ -d ${CONFIGS}/Security ]; then |
33 | | - sudo mv ${CONFIGS}/Certs ${CONFIGS}/Docker |
34 | | - sudo mv ${CONFIGS}/Docker/Certs ${CONFIGS}/Docker/certs |
35 | | - sudo mv ${CONFIGS}/nginx ${CONFIGS}/Docker |
36 | | - sudo mv ${CONFIGS}/Security ${CONFIGS}/Docker |
37 | | - sudo mv ${CONFIGS}/Docker/Security ${CONFIGS}/Docker/security |
38 | | - fi |
39 | | - |
40 | | - if [ -d /var/local/.Gooby ]; then |
41 | | - sudo mv /var/local/.Gooby/* ${CONFIGVARS} |
42 | | - sudo rm -r /var/local/.Gooby |
43 | | - fi |
44 | | - |
45 | | - if [ -d /var/local/Gooby/.config ]; then |
46 | | - sudo mv ${CONFIGS}/.config/* ${CONFIGVARS} |
47 | | - sudo mv ${CONFIGVARS}/rclonev ${CONFIGVARS}/rcloneversion |
48 | | - sudo mv ${CONFIGVARS}/upgrade ${CONFIGVARS}/version |
49 | | - sudo rm -r /var/local/Gooby/.config |
50 | | - fi |
51 | | - |
52 | | - # Upgrade Rclone service |
53 | | - |
54 | | - cat /etc/systemd/system/rclonefs.service | grep "pass" > /dev/null |
55 | | - if ! [[ ${?} -eq 0 ]]; then |
56 | | - sudo mv /etc/systemd/system/rclone* /tmp |
57 | | - sudo rsync -a /opt/Gooby/scripts/services/rclonefs* /etc/systemd/system/ |
58 | | - sudo sed -i "s/GOOBYUSER/${USER}/g" /etc/systemd/system/rclonefs.service |
59 | | - sudo systemctl daemon-reload |
60 | | - fi |
61 | | - |
62 | | - cat ${HOME}/.config/rclone/rclone.conf | grep "Local" > /dev/null |
63 | | - if ! [[ ${?} -eq 0 ]]; then |
64 | | - echo [Local] >> ${HOME}/.config/rclone/rclone.conf |
65 | | - echo type = local >> ${HOME}/.config/rclone/rclone.conf |
66 | | - echo nounc = >> ${HOME}/.config/rclone/rclone.conf |
67 | | - fi |
68 | | - |
69 | | - # Add resetbackup cron |
70 | | - |
71 | | - if crontab -l | grep 'backup.sh'; then |
72 | | - crontab -l | grep 'resetbackup' || (crontab -l 2>/dev/null; echo "10 2 1 * * /bin/resetbackup > /dev/null 2>&1") | crontab - |
73 | | - fi |
74 | | - |
75 | | - # Add Gooby branch |
76 | | - |
77 | | - if [ ! -s ${CONFIGVARS}/goobybranch ]; then |
78 | | - echo "master" > ${CONFIGVARS}/goobybranch |
79 | | - fi |
80 | | - |
81 | | - # Add proxy version |
82 | | - |
83 | | - if [ ! -s ${CONFIGVARS}/proxyversion ]; then |
84 | | - echo "nginx" > ${CONFIGVARS}/proxyversion |
85 | | - touch ${CONFIGVARS}/cf_email ${CONFIGVARS}/cf_key |
86 | | - fi |
87 | | - |
88 | | - if [ ! -d ${CONFIGS}/Docker/traefik ]; then |
89 | | - sudo mkdir -p ${CONFIGS}/Docker/traefik |
90 | | - sudo rsync -a /opt/Gooby/scripts/services/traefik.toml ${CONFIGS}/Docker/traefik/ |
91 | | - sudo sed -i "s/GOOBYDOMAIN/${MYDOMAIN}/g" ${CONFIGS}/Docker/traefik/traefik.toml |
92 | | - sudo sed -i "s/GOOBYEMAIL/${MYEMAIL}/g" ${CONFIGS}/Docker/traefik/traefik.toml |
93 | | - fi |
94 | | - |
95 | | - # Update Proxy |
96 | | - |
97 | | - if [ -f ${CONFIGS}/Docker/components/00-AAA.yaml ]; then |
98 | | - PROXYVERSION=$(cat ${CONFIGVARS}/proxyversion) |
99 | | - sudo rsync -a /opt/Gooby/scripts/${PROXYVERSION}/{00-version.yaml,01-proxy.yaml,99-network.yaml} ${CONFIGS}/Docker/components |
100 | | - sudo rm ${CONFIGS}/Docker/components/00-AAA.yaml |
101 | | - fi |
| 18 | + # Update and rename apps |
| 19 | + |
| 20 | + [[ -f ${CONFIGS}/Docker/components/00-version.yaml ]] && sudo mv ${CONFIGS}/Docker/components/00-version.yaml ${CONFIGS}/Docker/components/01-header.yaml |
| 21 | + [[ -f ${CONFIGS}/Docker/components/01-proxy.yaml ]] && sudo mv ${CONFIGS}/Docker/components/01-proxy.yaml ${CONFIGS}/Docker/components/03-proxy.yaml |
| 22 | + [[ -f ${CONFIGS}/Docker/components/02-netdata.yaml ]] && sudo mv ${CONFIGS}/Docker/components/02-netdata.yaml ${CONFIGS}/Docker/components/62-netdata.yaml |
| 23 | + [[ -f ${CONFIGS}/Docker/components/03-organizr-beta.yaml ]] && sudo mv ${CONFIGS}/Docker/components/03-organizr-beta.yaml ${CONFIGS}/Docker/components/11-organizr-beta.yaml |
| 24 | + [[ -f ${CONFIGS}/Docker/components/03-organizr.yaml ]] && sudo mv ${CONFIGS}/Docker/components/03-organizr.yaml ${CONFIGS}/Docker/components/11-organizr.yaml |
| 25 | + [[ -f ${CONFIGS}/Docker/components/98-watchtower.yaml ]] && sudo mv ${CONFIGS}/Docker/components/98-watchtower.yaml ${CONFIGS}/Docker/components/04-watchtower.yaml |
| 26 | + [[ -f ${CONFIGS}/Docker/components/10-portainer.yaml ]] && sudo mv ${CONFIGS}/Docker/components/10-portainer.yaml ${CONFIGS}/Docker/components/64-portainer.yaml |
| 27 | + [[ -f ${CONFIGS}/Docker/components/20-plex-beta.yaml ]] && sudo mv ${CONFIGS}/Docker/components/20-plex-beta.yaml ${CONFIGS}/Docker/components/21-plex-beta.yaml |
| 28 | + [[ -f ${CONFIGS}/Docker/components/20-plex-hw.yaml ]] && sudo mv ${CONFIGS}/Docker/components/20-plex-hw.yaml ${CONFIGS}/Docker/components/21-plex-hw.yaml |
| 29 | + [[ -f ${CONFIGS}/Docker/components/20-plex.yaml ]] && sudo mv ${CONFIGS}/Docker/components/20-plex.yaml ${CONFIGS}/Docker/components/21-plex.yaml |
| 30 | + [[ -f ${CONFIGS}/Docker/components/22-emby-beta.yaml ]] && sudo mv ${CONFIGS}/Docker/components/22-emby-beta.yaml ${CONFIGS}/Docker/components/22-emby-beta.yaml |
| 31 | + [[ -f ${CONFIGS}/Docker/components/22-emby-hw.yaml ]] && sudo mv ${CONFIGS}/Docker/components/22-emby-hw.yaml ${CONFIGS}/Docker/components/22-emby-hw.yaml |
| 32 | + [[ -f ${CONFIGS}/Docker/components/22-emby.yaml ]] && sudo mv ${CONFIGS}/Docker/components/22-emby.yaml ${CONFIGS}/Docker/components/22-emby.yaml |
| 33 | + [[ -f ${CONFIGS}/Docker/components/24-jellyfin.yaml ]] && sudo mv ${CONFIGS}/Docker/components/24-jellyfin.yaml ${CONFIGS}/Docker/components/23-jellyfin.yaml |
| 34 | + [[ -f ${CONFIGS}/Docker/components/25-tautulli.yaml ]] && sudo mv ${CONFIGS}/Docker/components/25-tautulli.yaml ${CONFIGS}/Docker/components/25-tautulli.yaml |
| 35 | + [[ -f ${CONFIGS}/Docker/components/26-embystat.yaml ]] && sudo mv ${CONFIGS}/Docker/components/26-embystat.yaml ${CONFIGS}/Docker/components/26-embystat.yaml |
| 36 | + [[ -f ${CONFIGS}/Docker/components/30-nzbget.yaml ]] && sudo mv ${CONFIGS}/Docker/components/30-nzbget.yaml ${CONFIGS}/Docker/components/31-nzbget.yaml |
| 37 | + [[ -f ${CONFIGS}/Docker/components/33-sabnzbd.yaml ]] && sudo mv ${CONFIGS}/Docker/components/33-sabnzbd.yaml ${CONFIGS}/Docker/components/32-sabnzbd.yaml |
| 38 | + [[ -f ${CONFIGS}/Docker/components/40-deluge.yaml ]] && sudo mv ${CONFIGS}/Docker/components/40-deluge.yaml ${CONFIGS}/Docker/components/41-deluge.yaml |
| 39 | + [[ -f ${CONFIGS}/Docker/components/41-rtorrent.yaml ]] && sudo mv ${CONFIGS}/Docker/components/41-rtorrent.yaml ${CONFIGS}/Docker/components/45-rtorrent.yaml |
| 40 | + [[ -f ${CONFIGS}/Docker/components/44-jackett.yaml ]] && sudo mv ${CONFIGS}/Docker/components/44-jackett.yaml ${CONFIGS}/Docker/components/56-jackett.yaml |
| 41 | + [[ -f ${CONFIGS}/Docker/components/50-radarr-beta.yaml ]] && sudo mv ${CONFIGS}/Docker/components/50-radarr-beta.yaml ${CONFIGS}/Docker/components/51-radarr-beta.yaml |
| 42 | + [[ -f ${CONFIGS}/Docker/components/50-radarr.yaml ]] && sudo mv ${CONFIGS}/Docker/components/50-radarr.yaml ${CONFIGS}/Docker/components/51-radarr.yaml |
| 43 | + [[ -f ${CONFIGS}/Docker/components/51-radarr4k-beta.yaml ]] && sudo mv ${CONFIGS}/Docker/components/51-radarr4k-beta.yaml ${CONFIGS}/Docker/components/59-radarr4k-beta.yaml |
| 44 | + [[ -f ${CONFIGS}/Docker/components/51-radarr4k.yaml ]] && sudo mv ${CONFIGS}/Docker/components/51-radarr4k.yaml ${CONFIGS}/Docker/components/59-radarr4k.yaml |
| 45 | + [[ -f ${CONFIGS}/Docker/components/52-sonarr.yaml ]] && sudo mv ${CONFIGS}/Docker/components/52-sonarr.yaml ${CONFIGS}/Docker/components/52-sonarr.yaml |
| 46 | + [[ -f ${CONFIGS}/Docker/components/54-lidarr.yaml ]] && sudo mv ${CONFIGS}/Docker/components/54-lidarr.yaml ${CONFIGS}/Docker/components/53-lidarr.yaml |
| 47 | + [[ -f ${CONFIGS}/Docker/components/60-ombi.yaml ]] && sudo mv ${CONFIGS}/Docker/components/60-ombi.yaml ${CONFIGS}/Docker/components/12-ombi.yaml |
| 48 | + [[ -f ${CONFIGS}/Docker/components/65-monitorr.yaml ]] && sudo mv ${CONFIGS}/Docker/components/65-monitorr.yaml ${CONFIGS}/Docker/components/13-monitorr.yaml |
| 49 | + [[ -f ${CONFIGS}/Docker/components/80-php.yaml ]] && sudo mv ${CONFIGS}/Docker/components/80-php.yaml ${CONFIGS}/Docker/components/81-phpapache.yaml |
| 50 | + [[ -f ${CONFIGS}/Docker/components/91-postgres.yaml ]] && sudo mv ${CONFIGS}/Docker/components/91-postgres.yaml ${CONFIGS}/Docker/components/73-postgres.yaml |
| 51 | + [[ -f ${CONFIGS}/Docker/components/99-network.yaml ]] && sudo mv ${CONFIGS}/Docker/components/99-network.yaml ${CONFIGS}/Docker/components/99-footer.yaml |
| 52 | + |
| 53 | + [[ ! -f ${CONFIGS}/Docker/components/02-oauth.yaml ]] && sudo rsync -a /opt/Gooby/scripts/${PROXYVERSION}/{01-header.yaml,02-oauth.yaml,03-proxy.yaml,04-watchtower.yaml,05-autoheal.yaml,99-footer.yaml} ${CONFIGS}/Docker/components |
102 | 54 |
|
103 | 55 | # Finalizing upgrade |
104 | 56 |
|
|
0 commit comments