Add command to open firewall ports

This commit is contained in:
Andreas Zweili 2023-11-14 15:58:59 +01:00
parent 58e6768253
commit 32ae61397a
1 changed files with 6 additions and 1 deletions

7
dev.sh
View File

@ -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 <task_name>\n\n"