From a384be1c818dee0474f950955ed7fce1b438ff6c Mon Sep 17 00:00:00 2001 From: Naglfar Date: Sat, 30 Mar 2019 14:01:39 +0000 Subject: [PATCH] znc user creation script doesn't require password since using imapauth --- .../files/var/lib/znc/create-znc_account.sh | 17 +++-------------- .../shell/files/var/lib/znc/znc_account.newconf | 4 +--- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/roles/shell/files/var/lib/znc/create-znc_account.sh b/roles/shell/files/var/lib/znc/create-znc_account.sh index 2d818f6..bcf61cc 100755 --- a/roles/shell/files/var/lib/znc/create-znc_account.sh +++ b/roles/shell/files/var/lib/znc/create-znc_account.sh @@ -5,9 +5,9 @@ CONF="/var/lib/znc/.znc/configs/znc.conf" PID=$(pgrep -u znc znc) # $username and $password are retrieved from create-account script -if [[ -z $1 || -z $2 ]] +if [ -z $1 ] then - echo -e "Usage: $(basename $0) [username] [password]" + echo -e "Usage: $(basename $0) [username]" exit fi @@ -19,23 +19,12 @@ then fi username=$1 -password=$2 kill -s USR1 $PID # Rewrite znc.conf sleep 1 -# set username and password +# set username sed s/newuser/$username/g znc_account.newconf >> $CONF -expect << EOF | grep -E 'Hash|Salt' | tr -d \\r >> $CONF -spawn znc --makepass -expect "*Enter password: " -send "$password\r" -expect "*Confirm password: " -send "$password\r" -expect eof -EOF -echo " " >> $CONF -echo "" >> $CONF sleep 1 kill -s HUP $PID # Reload znc.conf diff --git a/roles/shell/files/var/lib/znc/znc_account.newconf b/roles/shell/files/var/lib/znc/znc_account.newconf index 0c49eb0..aa38722 100644 --- a/roles/shell/files/var/lib/znc/znc_account.newconf +++ b/roles/shell/files/var/lib/znc/znc_account.newconf @@ -20,6 +20,4 @@ RealName = Got Thunix ? StatusPrefix = * TimestampFormat = [%H:%M:%S] - - - Method = SHA256 +