From be09a19914c3deee33823306be57798d3014675b Mon Sep 17 00:00:00 2001 From: fauno Date: Sat, 4 Jan 2025 13:34:25 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20configura=20ips=20est=C3=A1ticas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skel/scripts/static-ips | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 skel/scripts/static-ips 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