设为首页 加入收藏

TOP

RedHat Iptables 脚本移植给SUSE(三)
2014-11-24 02:01:54 来源: 作者: 【 】 浏览:7
Tags:RedHat Iptables 脚本 移植 SUSE
s missing and iptables modules are not
# loaded.
# Check if iptable module is loaded
if [ ! -f "$VAR_SUBSYS_IPTABLES" ]; then
echo $"Firewall is stopped."
return 1
fi


# Check if firewall is configured (has tables)
if [ ! -e "$PROC_IPTABLES_NAMES" ]; then
echo $"Firewall is not configured. "
return 1
fi
tables=`cat $PROC_IPTABLES_NAMES 2>/dev/null`
if [ -z "$tables" ]; then
echo $"Firewall is not configured. "
return 1
fi


NUM=
[ "x$IPTABLES_STATUS_NUMERIC" = "xyes" ] && NUM="-n"


for table in $tables; do
echo $"Table: $table"
$IPTABLES -t $table --list $NUM && echo
done


return 0
}


restart() {
if [ "x$IPTABLES_SAVE_ON_RESTART" = "xyes" ]; then
save;
rc_status -v
fi
stop
rc_status -v
start
}


case "$1" in
start)
stop
rc_status -v
start
rc_status -v
;;
stop)
if [ "x$IPTABLES_SAVE_ON_STOP" = "xyes" ]; then
save;
rc_status -v
fi
stop
rc_status -v
;;
restart)
restart
rc_status -v
;;
condrestart)
[ -e "$VAR_SUBSYS_IPTABLES" ] && restart
rc_status -v
;;
status)
status
rc_status -v
;;
panic)
flush_n_delete
set_policy DROP
rc_status -v
;;
save)
save
rc_status -v
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status|panic|save}"
exit 1
;;
esac


rc_exit;


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux的声卡驱动中ALSA与OSS的区.. 下一篇Ubuntu下编译最新boost1.39.0或1...

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: