Skip to content

Instantly share code, notes, and snippets.

@nicholasadamou
Created April 29, 2018 23:08
Show Gist options
  • Save nicholasadamou/e4a4bb5b0acb8f7b4086559db4d49ff9 to your computer and use it in GitHub Desktop.
Save nicholasadamou/e4a4bb5b0acb8f7b4086559db4d49ff9 to your computer and use it in GitHub Desktop.
Start's the FruityWiFi daemon + web-interface.
#!/bin/bash
HTTP_PORT=8000
HTTPS_PORT=8443
ipaddr="$(hostname -I | cut -d ' ' -f1)"
/etc/init.d/fruitywifi restart && /etc/init.d/php7.0-fpm restart
sudo fuser -k "$HTTP_PORT"/tcp &>/dev/null
sudo fuser -k "$HTTPS_PORT"/tcp &>/dev/null
/etc/init.d/nginx restart
if [ "$?" -eq 0 ]; then
echo
echo "---------------------------"
echo "WEB-INTERFACE"
echo "---------------------------"
echo "http://"$ipaddr":8000 [http]"
echo "https://"$ipaddr":8443 [https]"
echo "user: admin"
echo "pass: admin"
echo
else
echo "An error occured while starting (fruitywifi|php7.0-fpm|nginx) service(s)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment