Skip to content

Instantly share code, notes, and snippets.

@codeZoner
Created September 4, 2017 15:32
Show Gist options
  • Save codeZoner/5007c04867d2e214712a566440b7cdc2 to your computer and use it in GitHub Desktop.
Save codeZoner/5007c04867d2e214712a566440b7cdc2 to your computer and use it in GitHub Desktop.
Launch Demon Start up with Bash Script with Mariadb/Neo4j & Docker
<?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/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/[email protected]/bin/mysql:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/admin/go/bin</string>
</dict>
<key>Label</key>
<string>com.startup</string>
<key>Program</key>
<string>/Users/admin/Scripts/startup/startup.sh</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>LaunchOnlyOnce</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/startup.stdout</string>
<key>StandardErrorPath</key>
<string>/tmp/startup.stderr</string>
<key>UserName</key>
<string>admin</string>
<key>GroupName</key>
<string>admin</string>
<key>InitGroups</key>
<true/>
</dict>
</plist>
#!bin/bash
# Start Mariadb Server if it is not running
if [[ "$(mysql.server status)" =~ "not running" ]]; then
echo "Start Mariadb"
mysql.server start
echo "Started Mariadb"
else
echo "Mariadb Already Running"
fi
# Start Docker
docker-machine start default && docker-machine env default && eval "$(docker-machine env default)"
#Start Neo4j Server
if [[ "$(neo4j status)" =~ "not running" ]]; then
echo "Start Neo4j"
neo4j console
echo "Started Neo4j"
else
echo "Neo4j Already Running"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment