93 lines
1.4 KiB
Bash
93 lines
1.4 KiB
Bash
|
#!/bin/sh
|
||
|
|
||
|
restart_mails_service()
|
||
|
{
|
||
|
rcctl restart dovecot smtpd rspamd
|
||
|
}
|
||
|
|
||
|
restart_php_service(){
|
||
|
rcctl restart php80_fpm
|
||
|
}
|
||
|
|
||
|
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
|
||
|
|
||
|
|
||
|
}
|