@@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
88APP=" PeaNUT"
99var_tags=" ${var_tags:- network;ups;} "
1010var_cpu=" ${var_cpu:- 2} "
11- var_ram=" ${var_ram:- 3072 } "
11+ var_ram=" ${var_ram:- 4096 } "
1212var_disk=" ${var_disk:- 7} "
1313var_os=" ${var_os:- debian} "
1414var_version=" ${var_version:- 12} "
@@ -27,22 +27,31 @@ function update_script() {
2727 msg_error " No ${APP} Installation Found!"
2828 exit
2929 fi
30- RELEASE=$( curl -fsSL https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep ' "tag_name":' | cut -d' "' -f4)
31- if [[ ! -f /opt/${APP} _version.txt ]] || [[ " ${RELEASE} " != " $( cat /opt/${APP} _version.txt) " ]]; then
32- msg_info " Updating $APP to ${RELEASE} "
30+ if ! command -v jq & > /dev/null; then
31+ $STD apt-get install -y jq
32+ fi
33+ NODE_VERSION=" 22" NODE_MODULE=" pnpm" setup_nodejs
34+ RELEASE=$( curl -fsSL https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | jq -r ' .tag_name' | sed ' s/^v//' )
35+ if [[ " ${RELEASE} " != " $( cat ~ /.peanut 2> /dev/null) " ]] || [[ ! -f ~ /.peanut ]]; then
36+
37+ msg_info " Stopping $APP "
3338 systemctl stop peanut
34- curl -fsSL " https://api.github.com/repos/Brandawg93/PeaNUT/tarball/${RELEASE} " -o " peanut.tar.gz"
35- tar -xzf peanut.tar.gz -C /opt/peanut --strip-components=1
36- rm peanut.tar.gz
39+ msg_ok " Stopped $APP "
40+
41+ fetch_and_deploy_gh_release " peanut" " Brandawg93/PeaNUT" " tarball" " latest" " /opt/peanut"
42+
43+ msg_info " Updating $APP to ${RELEASE} "
3744 cd /opt/peanut
3845 $STD pnpm i
39- $STD pnpm run build
46+ $STD pnpm run build:local
4047 cp -r .next/static .next/standalone/.next/
4148 mkdir -p /opt/peanut/.next/standalone/config
4249 ln -sf /etc/peanut/settings.yml /opt/peanut/.next/standalone/config/settings.yml
43- systemctl start peanut
44- echo " ${RELEASE} " > /opt/${APP} _version.txt
4550 msg_ok " Updated $APP to ${RELEASE} "
51+
52+ msg_info " Starting $APP "
53+ systemctl start peanut
54+ msg_ok " Started $APP "
4655 else
4756 msg_ok " No update required. ${APP} is already at ${RELEASE} "
4857 fi
0 commit comments