Mac用のHyperEstraier起動スクリプト
まだMacの起動スクリプトのことをなんと呼べばいいのかわからないのですが、
とりあえずなくて困ったので、
HyperEstra
hyperestra
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www .apple.com /DTDs/Prop ertyList-1 .0.dtd"> 3 <plist version="1.0"> 4 <dict> 5 <key>Debug</key> 6 <false/> 7 <key>Label</key> 8 <string>org.macpor ts.hyperes traier</string> 9 <key>OnDemand</key> 10 <false/> 11 <key>ProgramArg uments</key> 12 <array> 13 <string>/opt/local /bin/daemo ndo</string> <string>--label=hy perestraie r</string> 14 <string>--start-cm d</string> 15 <string>/opt/local /etc/Launc hDaemons/o rg.macport s.hyperest raier/hype restraier. wrapper</string> 16 <string>start</string> 17 <string>;</string> 18 <string>--stop-cmd </string> 19 <string>/opt/local /etc/Launc hDaemons/o rg.macport s.hyperest raier/hype restraier. wrapper</string> 20 <string>stop</string> 21 <string>;</string> 22 <string>--restart- cmd</string> 23 <string>/opt/local /etc/Launc hDaemons/o rg.macport s.hyperest raier/hype restraier. wrapper</string> 24 <string>restart</string> 25 <string>;</string> 26 <string>--pid=none </string> 27 </array> 28 <key>RunAtLoad</key> 29 <false/> 30 </dict> 31 </plist>
plistファイルの中で指定されているhyperestra
は以下の通り。
1 !/bin/sh 2 # 3 # MacPorts generated daemondo support script 4 # 5 6 # 7 # Init 8 # 9 prefix=/opt/local 10 11 # 12 # Start 13 # 14 Start() 15 { 16 if test ! "`netstat -a -n | grep 1978`"; then 17 rm -f /opt/local /var/run/h yperestrai er/_pid 18 fi 19 20 /opt/local /bin/estma ster start -bg /opt/local /var/run/h yperestrai er 21 } 22 23 # 24 # Stop 25 # 26 Stop() 27 { 28 /opt/local /bin/estma ster stop /opt/local /var/run/h yperestrai er 29 } 30 31 # 32 # Restart 33 # 34 Restart() 35 { 36 Stop 37 Start 38 } 39 40 # 41 # Run 42 # 43 Run() 44 { 45 case $1 in 46 start ) Start ;; 47 stop ) Stop ;; 48 restart) Restart ;; 49 * ) echo "$0: unknown argument: $1";; 50 esac 51 } 52 53 # 54 # Run a phase based on the selector 55 # 56 Run $1
macportsで入れたmysql5-dev