diff --git a/skel/scripts/static-ips b/skel/scripts/static-ips new file mode 100755 index 0000000..7a389c8 --- /dev/null +++ b/skel/scripts/static-ips @@ -0,0 +1,24 @@ +#!/bin/sh + +set -o | grep -q pipefail && set -o pipefail +set -eu + +test -f /etc/tinc/${NETNAME}/static_ips + +case $2 in + tinc) + case $1 in + up) + # Agrega todas las IPs que pueda, si falla alguna, fallamos en + # general luego de probar todas. + for static_ip in `cat /etc/tinc/${NETNAME}/static_ips`; do + ip address add ${static_ip} dev ${INTERFACE} || ret=$? + done + ;; + down) ;; + esac + ;; + *) exit 1 ;; +esac + +exit $ret