38 lines
699 B
YAML
Executable File
38 lines
699 B
YAML
Executable File
---
|
|
|
|
cron__jobs:
|
|
|
|
'keepalive':
|
|
job: '/usr/local/lib/keepalive'
|
|
|
|
custom_files:
|
|
|
|
- dest: '/usr/local/lib/keepalive'
|
|
content: |
|
|
#!/bin/bash
|
|
|
|
check_mariadb()
|
|
{
|
|
pidof mariadbd >/dev/null 2>&1
|
|
}
|
|
|
|
restart_mariadb()
|
|
{
|
|
echo "restarting mariadb"| logger -t keepalive
|
|
/etc/init.d/mariadb restart
|
|
}
|
|
|
|
check_mariadb || restart_mariadb
|
|
|
|
check_website()
|
|
{
|
|
curl $ALIVE_URL >/dev/null 2>&1
|
|
}
|
|
|
|
restart_apache()
|
|
{
|
|
systemctl restart apache2
|
|
}
|
|
|
|
check_website || restart_apache
|