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 \