4 |
|
|
5 |
# default cmds |
# default cmds |
6 |
SVC_NAME=iptables |
SVC_NAME=iptables |
7 |
IPTABLES=/sbin/iptables |
IPTABLES=/usr/sbin/iptables |
8 |
IPTABLES_SAVE=/sbin/iptables-save |
IPTABLES_SAVE=/usr/sbin/iptables-save |
9 |
IPTABLES_RESTORE=/sbin/iptables-restore |
IPTABLES_RESTORE=/usr/sbin/iptables-restore |
10 |
IPTABLES_PROC=/proc/net/ip_tables_names |
IPTABLES_PROC=/proc/net/ip_tables_names |
11 |
|
SYSTEMDLIBDIR=/usr/lib/systemd |
12 |
|
|
13 |
# read config |
# read config |
14 |
source /etc/conf.d/${SVC_NAME} |
source /etc/conf.d/${SVC_NAME} |
18 |
if [[ ! -f ${IPTABLES_SAVE_PATH} ]] |
if [[ ! -f ${IPTABLES_SAVE_PATH} ]] |
19 |
then |
then |
20 |
echo "Not starting ${SVC_NAME}. First create some rules then run:" |
echo "Not starting ${SVC_NAME}. First create some rules then run:" |
21 |
echo "/etc/init.d/${SVC_NAME} save" |
echo "${SYSTEMDLIBDIR}/magellan-${SVC_NAME} save" |
22 |
exit 1 |
exit 1 |
23 |
fi |
fi |
24 |
return 0 |
return 0 |