Add command to open firewall ports
This commit is contained in:
parent
58e6768253
commit
32ae61397a
7
dev.sh
7
dev.sh
|
@ -63,7 +63,6 @@ run() {
|
||||||
_setup
|
_setup
|
||||||
find . -name __pycache__ -o -name "*.pyc" -delete
|
find . -name __pycache__ -o -name "*.pyc" -delete
|
||||||
url=$(_create_url)
|
url=$(_create_url)
|
||||||
sudo iptables -I INPUT -p tcp --dport $WEBPORT -j ACCEPT
|
|
||||||
printf "\n---\n webserver: $url\n---\n"
|
printf "\n---\n webserver: $url\n---\n"
|
||||||
_open_url $url
|
_open_url $url
|
||||||
}
|
}
|
||||||
|
@ -151,6 +150,12 @@ update() {
|
||||||
descriptions["update"]="Update the dependencies."
|
descriptions["update"]="Update the dependencies."
|
||||||
tasks["update"]=update
|
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
|
# only one task at a time
|
||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
printf "usage: dev <task_name>\n\n"
|
printf "usage: dev <task_name>\n\n"
|
||||||
|
|
Loading…
Reference in New Issue