From 38318fac86afe8a8e171afe0ab6871e99f58234e Mon Sep 17 00:00:00 2001 From: tea Date: Fri, 8 Nov 2024 21:03:52 +0100 Subject: [PATCH] np-subsonic: fix missing pw generator --- .config/zsh/functions/np-subsonic | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/zsh/functions/np-subsonic b/.config/zsh/functions/np-subsonic index 721a920..2b8268c 100755 --- a/.config/zsh/functions/np-subsonic +++ b/.config/zsh/functions/np-subsonic @@ -9,12 +9,19 @@ while IFS=\n read -r line; do cfg+=${line} done < ${XDG_CONFIG_HOME:-~/.config}/np-subsonic.cfg +local pwgen_cmd="print ${RANDOM}" +# if type pwgen >& -; then +# pwgen_cmd="pwgen 20 1" +# elif type pwqgen >& -; then +# pwgen_cmd=pwqgen +# fi + local host=${cfg[1]} local api_version=1.16.1 local useragent=np-subsonic local user=${cfg[2]} local password=${cfg[3]} -local salt=$(pwgen 20 1) +local salt=$(eval ${pwgen_cmd}) local token=$(print -n "${password}${salt}" | md5sum | cut -d' ' -f1) local response=$(curl --silent \