Skip to content

Commit 49f58fe

Browse files
committed
Add drop and restart commands
1 parent 22446e1 commit 49f58fe

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tunnel

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,22 @@ stopTunnel() {
1919
fi
2020
}
2121

22-
if [ "$1" == "stop" ]; then
22+
dropTunnel() {
2323
stopTunnel
24-
exit
25-
fi
24+
cf delete -f $CHISEL_APP_NAME
25+
}
26+
27+
restartTunnel() {
28+
echo "Restarting $CHISEL_APP_NAME"
29+
cf restart $CHISEL_APP_NAME
30+
}
31+
32+
case $1 in
33+
start) ;; # Just run the script...
34+
restart) restartTunnel;; # Restart the app, then run the script
35+
stop) stopTunnel; exit ;;
36+
drop) dropTunnel; exit ;;
37+
esac
2638

2739
echo "Starting $CHISEL_APP_NAME forwarding local port $CHISEL_LOCAL_PORT to remote port $CHISEL_REMOTE_PORT"
2840

0 commit comments

Comments
 (0)