Search the process id matching the effective user. Send a signal name to the specified process

This commit is contained in:
Blade of Darkness 2019-01-24 06:56:10 +00:00
parent c8b952774e
commit 260bee58db
1 changed files with 4 additions and 3 deletions

View File

@ -2,6 +2,7 @@
# ZNC account creation
CONF="$HOME/.znc/configs/znc.conf"
PID=$(pgrep -u znc znc)
# $username and $password are retrieved from create-account script
if [[ -z $1 || -z $2 ]]
@ -12,7 +13,7 @@ if
username=$1
password=$2
pkill -10 -u znc znc # Rewrite znc.conf
kill -s USR1 $PID # Rewrite znc.conf
sleep 1
# set username and password
@ -28,5 +29,5 @@ EOF
echo " </Pass>" >> $CONF
echo "</User>" >> $CONF
pkill -1 -u znc znc # Reload znc.conf
pkill -10 -u znc znc # Rewrite znc.conf
kill -s HUP $PID # Reload znc.conf
kill -s USR1 $PID # Rewrite znc.conf