Created
February 11, 2017 18:52
-
-
Save mendesbarreto/84501fe57c4e4ee7f75de1aa012fd50d to your computer and use it in GitHub Desktop.
Script to start Ngrok at raspberry every boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/init.d/ngrok | |
case "$1" in | |
start) | |
echo "Ngrok service is starting" | |
screen ./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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! I got 'must be connected to a terminal' errors with screen until I changed the screen line to be detached:
screen -d -m /usr/local/bin/ngrok start -all -config /home/pi/.ngrok2/ngrok.yml