conf_server/utils.sh

93 lines
1.4 KiB
Bash
Raw Normal View History

2023-01-11 01:03:34 +01:00
#!/bin/sh
restart_mails_service()
{
rcctl restart dovecot smtpd rspamd
}
restart_php_service(){
2023-05-15 23:16:25 +02:00
rcctl restart php81_fpm
2023-01-11 01:03:34 +01:00
}
restart_postgresql_service(){
rcctl restart postgresql
}
restart_smtp_service(){
rcctl restart smtpd
}
restart_imap_service(){
rcctl restart dovecot
}
restart_xmpp_service(){
rcctl restart prosody
}
restart_webserver_service(){
rcctl restart nginx
}
check_webserver_service(){
rcctl check nginx
if [ $? != 0 ]; then
echo "Web server(Nginx) service is not running"
exit 1;
fi
}
check_redis_service(){
rcctl check redis
if [ $? != 0 ]; then
echo "Redis service is not running"
exit 1;
fi
}
check_php_service(){
rcctl check php80_fpm
if [ $? != 0 ]; then
echo "PHP service is not running"
exit 1;
fi
}
check_postgresql_service(){
check_postgresql_service(){
rcctl check postgresql
if [ $? != 0 ]; then
echo "Postgresql service is not running"
exit 1;
fi
}
}
check_mails_service(){
rcctl check dovecot
if [ $? != 0 ]; then
echo "IMAP mail service is not running"
exit 1;
fi
rcctl check smtpd
if [ $? != 0 ]; then
echo "SMTP mail service is not running"
exit 1;
fi
rcctl check rspamd
if [ $? != 0 ]; then
echo "rspamd mail service is not running"
exit 1;
fi
}