add tinc to dockerfunc

This commit is contained in:
Frieder Schlesier 2018-06-15 18:14:09 +02:00
parent 3c5b0b13fb
commit ef9940c1ee
3 changed files with 22 additions and 0 deletions

View File

@ -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'

View File

@ -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

0
quicktinc.sh Normal file → Executable file
View File