From 32ae61397a83cfcff3943f093de37c399872acfc Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Tue, 14 Nov 2023 15:58:59 +0100 Subject: [PATCH] Add command to open firewall ports --- dev.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev.sh b/dev.sh index 6ded281..117fe2a 100755 --- a/dev.sh +++ b/dev.sh @@ -63,7 +63,6 @@ run() { _setup find . -name __pycache__ -o -name "*.pyc" -delete url=$(_create_url) - sudo iptables -I INPUT -p tcp --dport $WEBPORT -j ACCEPT printf "\n---\n webserver: $url\n---\n" _open_url $url } @@ -151,6 +150,12 @@ update() { descriptions["update"]="Update the dependencies." tasks["update"]=update +open-port() { + sudo iptables -I INPUT -p tcp --dport $WEBPORT -j ACCEPT +} +descriptions["op"]="(o)pen the (p)ort in iptables fireall." +tasks["op"]=open-port + # only one task at a time if [ $# != 1 ]; then printf "usage: dev \n\n"