tinc-up 305 B

12345678910111213141516171819
  1. #!/bin/sh
  2. OS=`uname`
  3. HERE=`dirname $0`
  4. . $HERE/vpn.conf
  5. . $HERE/router.conf
  6. IP4_ADDRESS=$IP4_PREFIX$(($IP4_BASE + $ROUTER_ID))
  7. case $OS in
  8. FreeBSD)
  9. ifconfig $INTERFACE $IP4_ADDRESS/$IP4_NETLEN
  10. ;;
  11. Linux)
  12. ip link set $INTERFACE up
  13. ip addr add $IP4_ADDRESS/$IP4_NETLEN dev $INTERFACE
  14. ;;
  15. esac