From baf10a0be8e52347b3f96da3042ba79d333fe1ec Mon Sep 17 00:00:00 2001 From: Joe Papperello Date: Thu, 7 Feb 2019 12:22:20 +0000 Subject: [PATCH] vpndocker func --- bashrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bashrc b/bashrc index 5a53bda..4d01902 100644 --- a/bashrc +++ b/bashrc @@ -25,6 +25,15 @@ if [[ -n $TMUX ]]; then fi } +function vpndocker() { + if [[ `stat -c '%a' /dev/net/tun` == '660' ]]; then + docker "$@" + else + echo 'lxc config device add penguin tun unix-char path=/dev/net/tun' | xclip -selection c + echo 'no access to /dev/net/tun' + fi +} + ec2-info() { IP=169.254.169.254 ssh $1 "curl -q http://$IP/latest/meta-data/$2" 2>/dev/null