Update vaultwarden.sh

tweak
This commit is contained in:
tteckster 2023-04-10 00:21:11 -04:00 committed by GitHub
parent ab2cd43c15
commit a472080127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ function update_script() {
if [[ -z "$NEWTOKEN" ]]; then exit; fi if [[ -z "$NEWTOKEN" ]]; then exit; fi
if ! command -v argon2 >/dev/null 2>&1; then apt-get install -y argon2 &>/dev/null; fi if ! command -v argon2 >/dev/null 2>&1; then apt-get install -y argon2 &>/dev/null; fi
TOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -t 2 -m 16 -p 4 -l 64 -e) TOKEN=$(echo -n ${NEWTOKEN} | argon2 "$(openssl rand -base64 32)" -t 2 -m 16 -p 4 -l 64 -e)
sed -i "s|ADMIN_TOKEN='.*'|ADMIN_TOKEN='${TOKEN}'|" /opt/vaultwarden/.env sed -i "s|ADMIN_TOKEN=.*|ADMIN_TOKEN='${TOKEN}'|" /opt/vaultwarden/.env
systemctl restart vaultwarden systemctl restart vaultwarden
fi fi
exit exit