File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
# first check that the knock command is available...
6
6
command -v knock > /dev/null 2>&1 || { echo >&2 " Requires 'knock' but it's not installed. Exiting." ; exit 1; }
7
7
8
- BASTION_IP=" 127.0.0.1" # insert your target ip here, or we can parameterise this
8
+ # change this!
9
+ BASTION_IP=" 12.12.12.12" # insert your target ip here, or we can parameterise this
9
10
10
- UNLOCK_PORTS=" 1234 5678 9012" # make up some ports to lock and unlock
11
+ # change these!
12
+ UNLOCK_PORTS=" 1234 1235 1236" # make up some ports to lock and unlock
11
13
12
- LOCK_PORTS=" 4312 8765 2109"
14
+ # change these!
15
+ LOCK_PORTS=" 1234 1235 1237"
13
16
14
17
if [[ $1 == ' unlock' ]]; then
15
18
16
19
# send knock
17
20
knock -v -d 350 $BASTION_IP $UNLOCK_PORTS
18
21
19
22
# test ssh
20
- nc -z -v -w2 $BASTION_IP
23
+ nc -z -v -w2 $BASTION_IP 22
21
24
22
25
elif [[ $1 == ' lock' ]]; then
23
26
You can’t perform that action at this time.
0 commit comments