aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/.scripts/AN2Linux.sh9
-rwxr-xr-xzsh/.zsh/aliases.zsh3
2 files changed, 12 insertions, 0 deletions
diff --git a/scripts/.scripts/AN2Linux.sh b/scripts/.scripts/AN2Linux.sh
new file mode 100755
index 0000000..263f932
--- /dev/null
+++ b/scripts/.scripts/AN2Linux.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [[ $1 && $2 && $3 ]];then
+ ssh-add -l |grep -q `ssh-keygen -lf $1 | awk '{print $2}'` || ssh-add $1
+ ssh root@$2 "/root/AN2Linux.sh start $(\ip addr show $3 | grep "inet " | cut -d'/' -f1 | awk '{print $2}')"; an2linuxserver.py; ssh root@$2 "/root/AN2Linux.sh stop $(\ip addr show $3 | grep "inet " | cut -d'/' -f1 | awk '{print $2}')";
+else
+ echo "Usage:"
+ echo " $0 <ssh_key> <ip_server> <interface>"
+fi
diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh
index b46df26..d095979 100755
--- a/zsh/.zsh/aliases.zsh
+++ b/zsh/.zsh/aliases.zsh
@@ -184,6 +184,9 @@ alias search="~/.scripts/searx.sh"
alias history="IFS=\$'\\n'; for line in \$(cat ~/.zhistory); do echo \$(date --rfc-3339=ns -d @\$(echo \$line | cut -d' ' -f2 | cut -d':' -f1 | grep -e '^[0-9]') | cut -d'.' -f1)' : '\$(echo \$line | cut -d' ' -f2- | cut -d';' -f2-); done"
alias historyt="cat .zhistory | cut -d' ' -f2- | cut -d';' -f2- | awk '{CMD[\$1]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}' | grep -v \"./\" | column -c3 -s \" \" -t | sort -nr | nl | head -n10"
alias myip="~/.scripts/ip.sh"
+alias an2l="~/.scripts/AN2Linux.sh"
+alias an2lpro="an2l ~/.ssh/id_rsa_mail 212.47.251.250 tun0"
+alias an2lperso="an2l ~/.ssh/id_rsa_mail 212.47.251.250 tun0"
alias has="HAS_ALLOW_UNSAFE=y has"
alias bc="bc -l"