Skip to content

Instantly share code, notes, and snippets.

@yongqianme
Forked from codeZoner/com.startup.plist
Last active August 9, 2022 01:00
Show Gist options
  • Save yongqianme/805960bd454ee0715a5fc5e5781f948b to your computer and use it in GitHub Desktop.
Save yongqianme/805960bd454ee0715a5fc5e5781f948b to your computer and use it in GitHub Desktop.
Launch Daemon Start up with Bash Script with omniEdge
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>Label</key>
<string>com.startup</string>
<key>Program</key>
<!-- Full Path to the Script File. -->
<string>~./startomniedge.sh</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>LaunchOnlyOnce</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/omniedge.stdout</string>
<key>StandardErrorPath</key>
<string>/tmp/omniedge.stderr</string>
<key>UserName</key>
<string>admin</string>
<key>GroupName</key>
<string>admin</string>
<key>InitGroups</key>
<true/>
</dict>
</plist>
# -w flag permanently adds the plist to the Launch Daemon
sudo launchctl load -w /Library/LaunchDaemons/com.omniedge.plist
# -w flag permanently remove the plist to the Launch Daemon
sudo launchctl unload -w /Library/LaunchDaemons/com.omniedge.plist
You can stop the launchctl process by
sudo launchctl stop /Library/LaunchDaemons/com.omniedge.plist
You can start the launchctl process by
sudo launchctl start -w /Library/LaunchDaemons/com.omniedge.plist
#!/bin/bash
sudo pkill omniedge
omniedge login -s <SECURITY KEY>
sudo omniedge join -n <VIRUTAL_NETWORK> &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment