Advertisement
JackoJammie

startfirewalldsl - if does execute curious

Sep 25th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.78 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # /etc/network/if-up.d/startfirewalldsl --> /root/bin/startfirewalldsl
  4.  
  5. case "$LOGICAL" in
  6.     ppp0)
  7.     logger -p daemon.info "FW:(1) Starte die Firewall fuer logisches Interface $LOGICAL.";
  8.     /root/bin/firewalldsl start ppp0
  9.     ;;
  10.     lo)
  11.     logger -p daemon.info "FW:(2) Starte NICHT die Firewall fuer logisches Interface $LOGICAL.";
  12.     ;;
  13.     *)
  14.     LANIP=`ip addr show dev $LOGICAL | sed -n -e 's/^\ *inet\ \([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}.[0-9]\{1,3\}\).*/\1/p'`
  15.     if echo $LANIP | grep 192.168.[0-1].*; then
  16.         logger -p daemon.info "FW:(3) Starte NICHT die Firewall fuer logisches Interface $LOGICAL.";
  17.     else
  18.         logger -p daemon.info "FW:(4) Starte die Firewall fuer logisches Interface $LOGICAL.";
  19.         /root/bin/firewalldsl start $LOGICAL;
  20.     fi
  21.     ;;
  22. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement