Skip to content

Instantly share code, notes, and snippets.

@bse666
Created May 8, 2018 22:25
Show Gist options
  • Save bse666/b6989824b4e7a1dc4824cf7f0d530304 to your computer and use it in GitHub Desktop.
Save bse666/b6989824b4e7a1dc4824cf7f0d530304 to your computer and use it in GitHub Desktop.
tinc in jail
#!/bin/sh
# Jails in Freenas use a tun Device for each Restart.
# This script gets the actual Device and sets it in the tinc config
# Edit NETWORKNAME to match your's.
TUN_DEVICE="/dev/`ifconfig | grep tun | awk '{print $1}' | sed s/://g`"
sed -i .orig "s#Device.*#Device = $TUN_DEVICE#" /usr/local/etc/tinc/NETWORKNAME/tinc.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment