Compare commits

..

No commits in common. "48a2f0a2a6d41f66c41a457806c520a96d57c1ef" and "0052550dc7a73f3356d5c78d8669cf744f1252c6" have entirely different histories.

2 changed files with 11 additions and 12 deletions

View File

@ -57,19 +57,16 @@ function update_script() {
header_info
if [[ ! -f /etc/systemd/system/peanut.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
RELEASE=$(curl -sL https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Updating $APP LXC"
systemctl stop peanut
wget -qO peanut.tar.gz https://api.github.com/repos/Brandawg93/PeaNUT/tarball/${RELEASE}
RELEASE_URL=$(curl -s https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep "tarball_url" | awk '{print substr($2, 2, length($2)-3)}')
wget -qO peanut.tar.gz $RELEASE_URL
tar -xzf peanut.tar.gz -C /opt/peanut --strip-components 1
rm peanut.tar.gz
cd /opt/peanut
pnpm i &>/dev/null
pnpm run build &>/dev/null
cp -r .next/static .next/standalone/.next/
systemctl start peanut
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP to ${RELEASE}"
msg_ok "Updated $APP LXC"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
@ -81,9 +78,10 @@ build_container
description
msg_info "Setting Container to Normal Resources"
pct set $CTID -memory 1024
pct set $CTID -memory 512
pct set $CTID -cores 1
msg_ok "Set Container to Normal Resources"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"
${BL}http://${IP}:3000${CL} \n
${YW}Don't forget to update the NUT configuration!${CL} \n"

View File

@ -18,6 +18,7 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y wget
$STD apt-get install -y gpg
msg_ok "Installed Dependencies"
@ -34,15 +35,15 @@ $STD apt-get install -y nut-client
msg_ok "Installed NUT"
msg_info "Installing Peanut"
RELEASE=$(curl -sL https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
wget -qO peanut.tar.gz https://api.github.com/repos/Brandawg93/PeaNUT/tarball/${RELEASE}
RELEASE_URL=$(curl -s https://api.github.com/repos/Brandawg93/PeaNUT/releases/latest | grep "tarball_url" | awk '{print substr($2, 2, length($2)-3)}')
wget -qO peanut.tar.gz $RELEASE_URL
mkdir -p /opt/peanut
tar -xzf peanut.tar.gz -C /opt/peanut --strip-components 1
rm peanut.tar.gz
cd /opt/peanut
$STD npm install -g pnpm
$STD pnpm i
$STD pnpm run build
$STD npm run build
cp -r .next/static .next/standalone/.next/
msg_ok "Installed Peanut"