show prompt when there are no user or password
This commit is contained in:
parent
64efacc6d8
commit
c8b952774e
|
@ -1,23 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# To merge it with 'create-account':
|
||||
# source create-znc_account/create-znc_account.sh
|
||||
|
||||
# to create backups?
|
||||
|
||||
# ZNC account creation
|
||||
CONF="$HOME/.znc/configs/znc.conf"
|
||||
|
||||
# $username and $password are retrieved from create-account script
|
||||
if [[ -z $username || -z $password ]] && [[ -z $1 || -z $2 ]]
|
||||
if [[ -z $1 || -z $2 ]]
|
||||
then
|
||||
echo -e "Usage: $(basename $0) [username] [password] "
|
||||
exit
|
||||
elif [[ -z $username && -z $password ]] || [[ -n $1 && -n $2 ]]
|
||||
then
|
||||
username=$1
|
||||
password=$2
|
||||
fi
|
||||
if
|
||||
username=$1
|
||||
password=$2
|
||||
|
||||
pkill -10 -u znc znc # Rewrite znc.conf
|
||||
sleep 1
|
||||
|
@ -35,7 +28,5 @@ EOF
|
|||
echo " </Pass>" >> $CONF
|
||||
echo "</User>" >> $CONF
|
||||
|
||||
sleep 1
|
||||
pkill -1 -u znc znc # Reload znc.conf
|
||||
sleep 1
|
||||
pkill -10 -u znc znc # Rewrite znc.conf
|
||||
|
|
Loading…
Reference in New Issue