One. Ngrok background Run
Nohup./ngrokd-domain="xxx.xxx.xxx" &
Two. Ngrok Boot up
1. In the Ngrok directory, create a new start.sh
Content is
Path=/home/pi/web/ngrok
Nohup $path/ngrok-config $path/ngrok.cfg-subdomin * * * 80
2. Add the Ngrok program as a system service
Create a new service item (Ngrok) under the/ETC/INIT.D directory
sudo vim Ngrok
- #!/bin/sh
# # # BEGIN INIT INFO
# Provides:ngrok
# Required-start: $remote _fs $syslog
# required-stop: $remote _fs $syslog
# Default-start:2 3 4 5
# default-stop:0 1 6
# Short-description:start Ngrok at boot time
# Description:enable service provided by Ngrok.
# # # END INIT INFO
- Ngrok_path=/home/pi/web/ngrok
- Case "$" in
- Start
- echo "Start Ngrok service ..."
- SH ${ngrok_path}/start.sh
- ;;
- *)
- Exit 1
- ;;
- Esac
3. Give permission to execute and update the service
sudo chmod 755 Ngrok
sudo update-rc.d ngrok defaults
Setup is complete, restart the machine to see if there is a normal.
Ngrok Related knowledge