From a05406e097573c7d8ca0a561d1952e9041847ea5 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Wed, 11 Nov 2026 22:47:21 +0100 Subject: [PATCH] whisparr-eros: set the first password in the unit, write creds with cat --- install/whisparr-eros-install.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/install/whisparr-eros-install.sh b/install/whisparr-eros-install.sh index ed2f329c8..f02ebb5d2 100644 --- a/install/whisparr-eros-install.sh +++ b/install/whisparr-eros-install.sh @@ -27,6 +27,7 @@ chmod 775 /var/lib/whisparr-eros/ /opt/Whisparr-Eros/ msg_ok "Configured Whisparr-Eros" msg_info "Creating Service" +WHISPARR_PASS=$(random_password 20) cat </etc/systemd/system/whisparr-eros.service [Unit] Description=Whisparr-Eros Daemon @@ -35,6 +36,7 @@ After=syslog.target network.target [Service] UMask=0002 Type=simple +Environment=WHISPARR__AUTH__INITIALPASSWORD=${WHISPARR_PASS} ExecStart=/opt/Whisparr-Eros/Whisparr -nobrowser -data=/var/lib/whisparr-eros/ TimeoutStopSec=20 KillMode=process @@ -43,24 +45,18 @@ Restart=on-failure [Install] WantedBy=multi-user.target EOF -WHISPARR_PASS=$(random_password 20) -mkdir -p /etc/systemd/system/whisparr-eros.service.d -cat </etc/systemd/system/whisparr-eros.service.d/initial-user.conf -[Service] -Environment=WHISPARR__AUTH__INITIALPASSWORD=${WHISPARR_PASS} -EOF systemctl enable -q --now whisparr-eros for _ in {1..60}; do grep -qs "created 'whisparr' with the configured password" /var/lib/whisparr-eros/logs/whisparr.txt && break sleep 2 done -rm -rf /etc/systemd/system/whisparr-eros.service.d +sed -i '/WHISPARR__AUTH__INITIALPASSWORD/d' /etc/systemd/system/whisparr-eros.service systemctl daemon-reload -{ - echo "Whisparr-Eros Credentials" - echo "Username: whisparr" - echo "Password: ${WHISPARR_PASS}" -} >~/whisparr-eros.creds +cat <~/whisparr-eros.creds +Whisparr-Eros Credentials +Username: whisparr +Password: ${WHISPARR_PASS} +EOF chmod 600 ~/whisparr-eros.creds msg_ok "Created Service"