diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-05 07:48:16 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-05 07:48:16 +0200 |
commit | 9b19480228d8421c3987a634a602012c953a993e (patch) | |
tree | 4bce21766502f3a72bb2002daeea2a406c2a3bda /dotfiles/scripts/AN2Linux.sh | |
parent | 40dddc15f4a323d3c84c84be7bb2c5ca94d3c07c (diff) | |
download | dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.tar.xz dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.zip |
Add some scripts
Diffstat (limited to '')
-rwxr-xr-x | dotfiles/scripts/AN2Linux.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dotfiles/scripts/AN2Linux.sh b/dotfiles/scripts/AN2Linux.sh new file mode 100755 index 0000000..263f932 --- /dev/null +++ b/dotfiles/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 |