Remove SIP user when using rmuser

This commit is contained in:
Bob Mottram 2015-11-02 10:56:02 +00:00
parent 5a0e192f48
commit 932100d862
4 changed files with 14 additions and 1 deletions

View File

@ -10999,6 +10999,8 @@ function install_sip {
echo '</sipwitch>' >> /etc/sipwitch.conf
sed -i 's|#PLUGINS=|PLUGINS=|g' /etc/default/sipwitch
groupadd sipwitch
usermod -aG sipwitch $MY_USERNAME
service sipwitch start

View File

@ -100,6 +100,7 @@ function add_sip_user {
echo "$line" >> $NEW_CONFIG_FILE
done
mv $NEW_CONFIG_FILE $CONFIG_FILE
usermod -aG sipwitch $MY_USERNAME
}
while [[ $# > 1 ]]

View File

@ -34,6 +34,7 @@ SSH_PUBLIC_KEY="$2"
GPG_KEYSERVER='hkp://keys.gnupg.net'
SSH_PORT=2222
COMPLETION_FILE=$HOME/freedombone-completed.txt
SIP_EXTENSION=
if [ ! $MY_USERNAME ]; then
echo 'No username was given'
@ -214,6 +215,9 @@ fi
clear
echo "New user $MY_USERNAME was created"
if [ $SIP_EXTENSION ]; then
echo "Their SIP phone extension is $SIP_EXTENSION"
fi
echo "Their login password is $NEW_USER_PASSWORD"
echo ''
echo 'IMPORTANT: Make a note of the password, because it will not be saved'

View File

@ -41,7 +41,9 @@ if [[ $yn != 'y' && $yn != 'Y' && $yn != 'yes' && $yn != 'Yes' && $yn != 'YES' ]
exit 7
fi
freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
if grep -q "install_xmpp" $COMPLETION_FILE; then
freedombone-rmxmpp -e "$MY_USERNAME@$HOSTNAME"
fi
if grep -q "Blog domain" $COMPLETION_FILE; then
FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
@ -50,6 +52,10 @@ if grep -q "Blog domain" $COMPLETION_FILE; then
fi
fi
if grep -q "install_sip" $COMPLETION_FILE; then
freedombone-rmsipuser $MY_USERNAME
fi
userdel -r $MY_USERNAME
if [ -d /home/$MY_USERNAME ]; then