From ef9940c1ee16991a114c54787cb0b1ebbd049c9c Mon Sep 17 00:00:00 2001 From: Frieder Schlesier Date: Fri, 15 Jun 2018 18:14:09 +0200 Subject: [PATCH] add tinc to dockerfunc --- .aliases | 1 + .dockerfunc | 21 +++++++++++++++++++++ quicktinc.sh | 0 3 files changed, 22 insertions(+) mode change 100644 => 100755 quicktinc.sh diff --git a/.aliases b/.aliases index 8e2b443..51b0484 100755 --- a/.aliases +++ b/.aliases @@ -2,6 +2,7 @@ alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' +alias rsync='rsync --progress -v' alias ll='ls -ahlF' alias la='ls -Ah' diff --git a/.dockerfunc b/.dockerfunc index 51c8d2a..37cc074 100755 --- a/.dockerfunc +++ b/.dockerfunc @@ -568,6 +568,27 @@ skype() { exit 0; } +# call with net-name as param +tinc() { + local tinc_dir="${HOME}/.config/etc-tinc" + local NET_NAME=$1 + if [[ -z ${NET_NAME} ]]; then + echo "Error: tinc needs to be called with a net-name!!" + else + local tinc_name=$(grep -Po '(?<=Name = )[\w]+' ${tinc_dir}/${NET_NAME}/tinc.conf) + local container_name="tinc_${tinc_name}" + echo " running ${container_name} in net ${NET_NAME}" + docker run -d \ + --restart always \ + --name= \ + --device=/dev/net/tun \ + --cap-add NET_ADMIN \ + --volume ${tinc_dir}:/etc/tinc \ + ${DOCKER_REPO_PREFIX}/tinc \ + -n ${NET_NAME} start -D + fi +} + torbrowser() { del_stopped torbrowser diff --git a/quicktinc.sh b/quicktinc.sh old mode 100644 new mode 100755