1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: firewalld
5# Required-Start: $syslog $local_fs messagebus
6# Required-Stop:
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description:
10# Description:
11### END INIT INFO
12
13. /etc/init.d/functions
14
15firewalld=/usr/sbin/firewalld
16pidfile=/var/run/firewalld.pid
17
18case "$1" in
19    start)
20        echo -n "Starting firewalld: "
21        start-stop-daemon --start --quiet --exec $firewalld
22        echo "."
23        ;;
24    stop)
25        echo -n "Stopping firewalld: "
26        start-stop-daemon --stop --quiet --pidfile $pidfile
27        echo "."
28        ;;
29    restart)
30        echo -n "Stopping firewalld: "
31        start-stop-daemon --stop --quiet --pidfile $pidfile
32        echo "."
33        echo -n "Starting firewalld: "
34        start-stop-daemon --start --quiet --exec $firewalld
35        echo "."
36        ;;
37    reload)
38        echo -n "Reloading firewalld: "
39        firewall-cmd --reload
40        echo "."
41        ;;
42    status)
43        firewall-cmd --state
44        ;;
45    *)
46        echo "Usage: /etc/init.d/firewalld {start|stop|restart|reload|status}" >&2
47        exit 1
48esac
49