Remove old daemon commands

This commit is contained in:
Bob Mottram 2017-06-01 13:01:37 +01:00
parent 03b065c71d
commit 1163ffd146
8 changed files with 25 additions and 32 deletions

View File

@ -146,7 +146,7 @@ function restore_local_sip {
exit 3679 exit 3679
fi fi
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
service sipwitch restart systemctl restart sipwitch
echo $"Restore of SIP settings complete" echo $"Restore of SIP settings complete"
fi fi
} }
@ -212,7 +212,7 @@ function update_sipwitch_daemon {
return return
fi fi
service sipwitch stop systemctl stop sipwitch
# remove the original sipwitch daemon if it exists # remove the original sipwitch daemon if it exists
if [ -f /etc/init.d/sipwitch ]; then if [ -f /etc/init.d/sipwitch ]; then

View File

@ -447,7 +447,7 @@ function restore_local_xmpp {
exit 725 exit 725
fi fi
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
service prosody restart systemctl restart prosody
chown -R prosody:prosody /var/lib/prosody/* chown -R prosody:prosody /var/lib/prosody/*
echo $"Restore of xmpp settings complete" echo $"Restore of xmpp settings complete"
fi fi
@ -472,7 +472,7 @@ function restore_remote_xmpp {
exit 725 exit 725
fi fi
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
service prosody restart systemctl restart prosody
chown -R prosody:prosody /var/lib/prosody/* chown -R prosody:prosody /var/lib/prosody/*
echo $"Restore of xmpp settings complete" echo $"Restore of xmpp settings complete"
fi fi

View File

@ -92,7 +92,7 @@ function suspend_site {
fi fi
SUSPENDED_SITE="$1" SUSPENDED_SITE="$1"
nginx_dissite $SUSPENDED_SITE nginx_dissite $SUSPENDED_SITE
service nginx reload systemctl reload nginx
} }
function restart_site { function restart_site {
@ -101,7 +101,7 @@ function restart_site {
return return
fi fi
nginx_ensite $SUSPENDED_SITE nginx_ensite $SUSPENDED_SITE
service nginx reload systemctl reload nginx
SUSPENDED_SITE= SUSPENDED_SITE=
} }

View File

@ -121,28 +121,21 @@ function install_toxcore {
sudo cp /tmp/tox-bootstrapd.conf /etc/tox-bootstrapd.conf sudo cp /tmp/tox-bootstrapd.conf /etc/tox-bootstrapd.conf
rm /tmp/tox-bootstrapd.conf rm /tmp/tox-bootstrapd.conf
if [ -f /bin/systemctl ]; then if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service" exit 7359
exit 7359
fi
sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable tox-bootstrapd.service
sudo systemctl start tox-bootstrapd.service
if [ ! "$?" = "0" ]; then
sudo systemctl status tox-bootstrapd.service
exit 5846
fi
sudo systemctl restart tox-bootstrapd.service
else
sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.sh /etc/init.d/tox-bootstrapd
sudo chmod 755 /etc/init.d/tox-bootstrapd
sudo update-rc.d tox-bootstrapd defaults
sudo service tox-bootstrapd start
fi fi
sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable tox-bootstrapd.service
sudo systemctl start tox-bootstrapd.service
if [ ! "$?" = "0" ]; then
sudo systemctl status tox-bootstrapd.service
exit 5846
fi
sudo systemctl restart tox-bootstrapd.service
TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1) TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then

View File

@ -135,7 +135,7 @@ function renew_startssl {
sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME
echo $'Certificate installed' echo $'Certificate installed'
service nginx restart systemctl restart nginx
return return
fi fi

View File

@ -205,7 +205,7 @@ function restore_mariadb {
exit 962 exit 962
fi fi
echo $"Restarting database" echo $"Restarting database"
service mysql restart systemctl restart mysql
echo $"Change the MariaDB password to the backup version" echo $"Change the MariaDB password to the backup version"
DATABASE_PASSWORD="$db_pass" DATABASE_PASSWORD="$db_pass"
${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD" ${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD"

View File

@ -198,7 +198,7 @@ function restore_mariadb {
exit 962 exit 962
fi fi
echo $"Restarting database" echo $"Restarting database"
service mysql restart systemctl restart mysql
echo $"Change the MariaDB password to the backup version" echo $"Change the MariaDB password to the backup version"
DATABASE_PASSWORD="$db_pass" DATABASE_PASSWORD="$db_pass"
${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD" ${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD"

View File

@ -35,7 +35,7 @@ function suspend_site {
# suspends a given website # suspends a given website
SUSPENDED_SITE="$1" SUSPENDED_SITE="$1"
nginx_dissite $SUSPENDED_SITE nginx_dissite $SUSPENDED_SITE
service nginx reload systemctl reload nginx
} }
function restart_site { function restart_site {
@ -44,7 +44,7 @@ function restart_site {
return return
fi fi
nginx_ensite $SUSPENDED_SITE nginx_ensite $SUSPENDED_SITE
service nginx reload systemctl reload nginx
SUSPENDED_SITE= SUSPENDED_SITE=
} }