Merge branch 'dev' of github.com:Nebucatnetzer/network_inventory into dev
This commit is contained in:
commit
46b0c579e1
20
dev.sh
20
dev.sh
|
@ -40,6 +40,22 @@ _setup () {
|
|||
overmind quit
|
||||
sleep 2
|
||||
}
|
||||
|
||||
_open_url () {
|
||||
if [[ ! -z "${DEFAULT_BROWSER}" ]]; then
|
||||
$DEFAULT_BROWSER $url
|
||||
elif type explorer.exe &> /dev/null; then
|
||||
explorer.exe $url
|
||||
fi
|
||||
}
|
||||
|
||||
_create_url () {
|
||||
if [ -f /etc/wsl.conf ]; then
|
||||
echo "http://localhost:$WEBPORT"
|
||||
else
|
||||
echo "http://$(hostname -f):$WEBPORT"
|
||||
fi
|
||||
}
|
||||
#}
|
||||
|
||||
# Main tasks start
|
||||
|
@ -49,9 +65,11 @@ declare -A descriptions
|
|||
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: http://$(hostname -f):$WEBPORT\n---\n"
|
||||
overmind start -D
|
||||
printf "\n---\n webserver: $url\n---\n"
|
||||
_open_url $url
|
||||
}
|
||||
descriptions["run"]="Start the webserver."
|
||||
tasks["run"]=run
|
||||
|
|
Loading…
Reference in New Issue