Skip to content

Commit dbb3770

Browse files
author
Justin Miller
committed
modified action script to work better on OSX
1 parent d9a95a4 commit dbb3770

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

action

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
# first check that the knock command is available...
66
command -v knock >/dev/null 2>&1 || { echo >&2 "Requires 'knock' but it's not installed. Exiting."; exit 1; }
77

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
910

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
1113

12-
LOCK_PORTS="4312 8765 2109"
14+
# change these!
15+
LOCK_PORTS="1234 1235 1237"
1316

1417
if [[ $1 == 'unlock' ]]; then
1518

1619
# send knock
1720
knock -v -d 350 $BASTION_IP $UNLOCK_PORTS
1821

1922
# test ssh
20-
nc -z -v -w2 $BASTION_IP
23+
nc -z -v -w2 $BASTION_IP 22
2124

2225
elif [[ $1 == 'lock' ]]; then
2326

0 commit comments

Comments
 (0)