Use onliner for updates (#4414)

This commit is contained in:
Slaviša Arežina
2025-05-12 16:07:07 +02:00
committed by GitHub
parent 4a3ee4db67
commit 9140fd52ac
19 changed files with 106 additions and 115 deletions

View File

@@ -37,14 +37,15 @@ function update_script() {
header_info
case $CHOICE in
1)
apk update && apk upgrade && rc-service vaultwarden restart -q
$STD apk -U upgrade
rc-service vaultwarden restart -q
exit
;;
2)
if NEWTOKEN=$(whiptail --backtitle "Proxmox VE Helper Scripts" --passwordbox "Setup your ADMIN_TOKEN (make it strong)" 10 58 3>&1 1>&2 2>&3); then
if [[ -z "$NEWTOKEN" ]]; then exit-script; fi
if ! command -v argon2 >/dev/null 2>&1; then apk add argon2 &>/dev/null; fi
TOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
TOKEN=$(echo -n "${NEWTOKEN}" | argon2 "$(openssl rand -base64 32)" -e -id -k 19456 -t 2 -p 1)
if [[ ! -f /var/lib/vaultwarden/config.json ]]; then
sed -i "s|export ADMIN_TOKEN=.*|export ADMIN_TOKEN='${TOKEN}'|" /etc/conf.d/vaultwarden
else
@@ -65,4 +66,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8000${CL} \n"
${BL}http://${IP}:8000${CL} \n"