File tree Expand file tree Collapse file tree 2 files changed +29
-15
lines changed
Expand file tree Collapse file tree 2 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -20,17 +20,35 @@ color
2020catch_errors
2121
2222function update_script() {
23- UPD=$( whiptail --backtitle " Proxmox VE Helper Scripts" --title " SUPPORT" --radiolist --cancel-button Exit-Script " Spacebar = Select" 11 58 1 \
24- " 1" " Check for Alpine Updates" ON \
23+ UPD=$( whiptail --backtitle " Proxmox VE Helper Scripts" --title " UPDATE MODE" --radiolist --cancel-button Exit-Script " Spacebar = Select" 14 60 2 \
24+ " 1" " Check for Alpine Updates" OFF \
25+ " 2" " Update NPMplus Docker Container" ON \
2526 3>&1 1>&2 2>&3 )
2627
27- header_info
28- if [ " $UPD " == " 1" ]; then
29- apk update && apk upgrade
30- exit
31- fi
28+ header_info " $APP "
29+
30+ case " $UPD " in
31+ " 1" )
32+ msg_info " Updating Alpine OS"
33+ apk update && apk upgrade
34+ msg_ok " System updated"
35+ exit
36+ ;;
37+ " 2" )
38+ msg_info " Updating NPMplus Container"
39+ cd /opt || exit 1
40+ msg_info " Pulling latest container image"
41+ $STD docker compose pull
42+ msg_info " Recreating container"
43+ $STD docker compose up -d
44+ msg_ok " NPMplus container updated"
45+ exit
46+ ;;
47+ esac
48+ exit 0
3249}
3350
51+
3452start
3553build_container
3654description
Original file line number Diff line number Diff line change @@ -15,14 +15,9 @@ update_os
1515
1616msg_info " Installing Dependencies"
1717$STD apk add \
18- newt \
19- curl \
20- openssh \
2118 tzdata \
22- nano \
2319 gawk \
24- yq \
25- mc
20+ yq
2621msg_ok " Installed Dependencies"
2722
2823msg_info " Installing Docker & Compose"
@@ -95,7 +90,7 @@ customize
9590msg_info " Retrieving Default Login (Patience)"
9691PASSWORD_FOUND=0
9792for i in {1..60}; do
98- PASSWORD_LINE=$( docker logs " $CONTAINER_ID " 2>&1 | grep -m1 " Creating a new user:" )
93+ PASSWORD_LINE=$( docker logs " $CONTAINER_ID " 2>&1 | awk ' / Creating a new user:/ { print; exit } ' )
9994 if [[ -n " $PASSWORD_LINE " ]]; then
10095 PASSWORD=$( echo " $PASSWORD_LINE " | awk -F ' password: ' ' {print $2}' )
10196 echo -e
" username: [email protected] \npassword: $PASSWORD " > /opt/.npm_pwd
@@ -107,5 +102,6 @@ for i in {1..60}; do
107102done
108103
109104if [[ $PASSWORD_FOUND -eq 0 ]]; then
110- msg_ok " No default login found, use docker ps & docker logs for container password."
105+ msg_error " Could not retrieve default login after 60 seconds."
106+ echo -e " \nYou can manually check the container logs with:\n docker logs $CONTAINER_ID | grep 'Creating a new user:'\n"
111107fi
You can’t perform that action at this time.
0 commit comments