📄 s10pfil
字号:
#!/bin/shPFILAP=/etc/opt/pfil/iu.apfixif(){ ifconfig $1 2>/dev/null 1>&2 if [ $? -ne 0 ] ; then ifconfig $1 plumb ifconfig $1 unplumb fi}fixtun(){ # Unfortunately tunnels are implemented using # a streams modules, not a device driver so # autopush isn't of much help. The current # approach is to see if /usr/bin exists in # which case it's late enough in the game # to plumb the tunnel and modinsert pfil. ifname="$1" if [ -d /usr/bin ] ; then ifconfig $ifname plumb set -- `ifconfig $ifname modlist` pos="" while [ $# -ge 2 -a -z "$pos" ] do case "$2" in tun) pos="$1" ;; pfil) return ;; *) ;; esac shift 2 done if [ -n "$pos" ] ; then ifconfig $ifname modinsert pfil@$pos fi fi}case "$1" in start) if [ ! -f /etc/ipf.conf -a ! -f /etc/opt/ipf/ipf.conf ] ; then exit 0; fi iflist="`echo /etc/hostname.*[0-9] 2>/dev/null`" if [ "$iflist" != '/etc/hostname.*[0-9]' ] ; then ( y=xxx x=$IFS for i in /etc/hostname.*[0-9]; do ORIGIFS="$IFS" IFS="$IFS.:" set -- $i IFS="$ORIGIFS" case "$2" in # Handle tunnels ip|ip6) ifname="$2.$3" fixtun $ifname continue ;; # Normal interfaces *) ifname="$2" ;; esac if [ $ifname != $y ] ; then y=$ifname fixif $ifname fi done ) fi echo > /dev/pfil autopush -f ${PFILAP} 2>/dev/null 1>&2 ;; *) echo "Usage: $0 start" >&2 exit 1 ;;esacexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -