Skip to content

Instantly share code, notes, and snippets.

@nalakawula
Forked from mendesbarreto/ngrokService.sh
Last active June 10, 2019 13:15
Show Gist options
  • Save nalakawula/2ea1c103a4ffe2f7991a8dcfce6896ee to your computer and use it in GitHub Desktop.
Save nalakawula/2ea1c103a4ffe2f7991a8dcfce6896ee to your computer and use it in GitHub Desktop.
Script to start Ngrok at raspberry every boot
#! /bin/sh
# /etc/init.d/ngrok
case "$1" in
start)
echo "Ngrok service is starting"
screen -d m /etc/init.d/ngrok start -all -config /home/pi/.ngrok2/ngrok.yml
echo "Ngrok service was started"
;;
stop)
echo "Ngrok is stopping"
killall ngrok
echo "Service ngrok was stopped"
;;
*)
echo "Usage: /etc/init.d/ngrok.sh {start|stop}"
exit 1
;;
esac
exit 0
#!/bin/sh -e
# /etc/rc.local
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/etc/init.d/ngrok.sh start
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment