Skip to content

Commit 1627e9e

Browse files
author
Duke B
committed
add ssher
1 parent b5705cc commit 1627e9e

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

ssher

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
IFS=',' read -a ips <<< "$1"; shift
4+
commands="cd irsec2025"
5+
echo "${ips[@]}"
6+
7+
for ip in "${ips[@]}"; do
8+
echo $ip
9+
done
10+
11+
for arg in "$@"; do
12+
echo $arg
13+
if [ "$arg" = "r" ] || [ "$arg" = "c" ] || [ "$arg" = "clean" ]; then
14+
for ip in "${ips[@]}"; do
15+
ssh "$ip" "rm -rf irsec2025"
16+
done
17+
elif [ "$arg" = "i" ] || [ "$arg" = "install" ]; then
18+
for ip in "${ips[@]}"; do
19+
scp -qr $(pwd) "$ip":
20+
done
21+
else
22+
commands+="; echo; $arg"
23+
fi
24+
done
25+
26+
for ip in "${ips[@]}"; do
27+
ssh -t "$ip" "$commands"
28+
done
29+

0 commit comments

Comments
 (0)