File: checkload

package info (click to toggle)
libapache2-mod-lisp 1.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: ansic: 2,085; makefile: 24; sh: 21
file content (28 lines) | stat: -rwxr-xr-x 389 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

STATUS_SKIP=77

check_apache() {
    netstat --tcp -ln | grep 80

    if [ "$?" != 0 ]; then
        echo "apache2 is not listening at port TCP/80"
        echo "ending $0 with status $STATUS_SKIP"
        exit $STATUS_SKIP
    fi
}

load_module() {
    a2enmod lisp
}

restart_apache() {
    systemctl restart apache2
}

## main
check_apache
load_module
restart_apache

exit 0