aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-03-30 09:31:20 +0200
committerneodarz <neodarz@neodarz.net>2018-03-30 09:31:20 +0200
commitd0e8ca9c173b109377a3ee05b8d8347f5a34cbcd (patch)
tree46f723ad65241e2df584264d19f4f01167ef3965 /scripts
parentb077c30a51c9fb894696e176b993dec0c5eb709b (diff)
downloaddotfiles_ascii-d0e8ca9c173b109377a3ee05b8d8347f5a34cbcd.tar.xz
dotfiles_ascii-d0e8ca9c173b109377a3ee05b8d8347f5a34cbcd.zip
Add AN2Linux script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/.scripts/AN2Linux.sh9
1 files changed, 9 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