commit 057f077c57fab7b8f27916706767f21e43265026 parent 2b34fda184bc7670df8496eaeefaa345c673a74e Author: Josuah Demangeon <mail@josuah.net> Date: Wed, 7 Feb 2018 23:15:58 +0100 [add] tinc-up: no need to edit by hand, use variables Diffstat:
D | skel/tinc-up | | | 12 | ------------ |
A | tinc/tinc-up | | | 11 | +++++++++++ |
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/skel/tinc-up b/skel/tinc-up @@ -1,12 +0,0 @@ -#!/bin/sh -xe - -# t470s -#ifconfig "${INTERFACE}" 172.16.55.1 netmask 255.255.255.0 - -# nas -#ip link set "${INTERFACE}" up -#ip addr add 172.16.55.2/24 dev "${INTERFACE}" - -# rpi -#ip link set "${INTERFACE}" up -#ip addr add 172.16.55.3/24 dev "${INTERFACE}" diff --git a/tinc/tinc-up b/tinc/tinc-up @@ -0,0 +1,11 @@ +#!/bin/sh -xe + +case "$(uname)" in +(*BSD) + ifconfig "${INTERFACE}" "${SUBNET}" netmask 255.255.255.0 + ;; +(Linux) + ip link set "${INTERFACE}" up + ip addr add "${SUBNET}/24 dev "${INTERFACE}" + ;; +esac