Blokovani pres konstantu
[mirrors/Programs.git] / bash / clusterssh-scan.sh
1 #!/bin/bash
2
3 scan_for_ssh() {
4 for i in $( seq 158 255 ); do
5 # echo 1 "$1"."$i" 22;
6 nc -z -w 1 "$1"."$i" 22;
7 if [ "$?" = 0 ]; then
8 echo -n "$1.$i ";
9 fi;
10 done;
11 echo;
12 }
13
14 get_ssh_logins() {
15 for i in $( scan_for_ssh "$2" ); do
16 echo -n "$1"@"$i ";
17 done;
18 echo;
19 }
20
21 get_ip_range() {
22 for i in $( seq 158 255 ); do
23 echo -n "$1.$i ";
24 done;
25 echo;
26 }
27
28 #cssh $( get_ssh_logins root 192.168.2 )
29
30 cssh -T "Klub SSPS" root@192.168.2.161
This page took 0.39958 seconds and 4 git commands to generate.