Skip to content

Instantly share code, notes, and snippets.

@audibleblink
Last active June 19, 2023 02:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audibleblink/0fc9306172715eaaa9ff to your computer and use it in GitHub Desktop.
Save audibleblink/0fc9306172715eaaa9ff to your computer and use it in GitHub Desktop.
launchd file to keep ngrok alive; requires you have an ngrok config file with your connection definitions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>io.ngrok.start</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/ngrok</string>
<string>start</string>
<string>--all</string>
</array>
<key>StandardOutPath</key>
<string>/tmp/ngrok.log</string>
<key>StandardErrorPath</key>
<string>/tmp/ngrok.log</string>
</dict>
</plist>
@audibleblink
Copy link
Author

  • Save in /Library/LaunchDaemons
  • Register it with: sudo launchstl load /Library/LaunchDaemons/io.ngrok.client.plist

@YenHub
Copy link

YenHub commented Aug 13, 2021

sudo launchstl load /Library/LaunchDaemons/io.ngrok.client.plist

The command required is launchctl as opposed to launchstl

sudo launchctl load /Library/LaunchDaemons/io.ngrok.client.plist

Thanks for sharing! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment