• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

freedev/macosx-script-boot-shutdown: This project is useful to execute a shell s ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

freedev/macosx-script-boot-shutdown

开源软件地址(OpenSource Url):

https://github.com/freedev/macosx-script-boot-shutdown

开源编程语言(OpenSource Language):

Shell 100.0%

开源软件介绍(OpenSource Introduction):

macosx-script-boot-shutdown

This configuration is useful when you need to execute a shell script at Mac OS X boot or shutdown.

There are two files:

  • boot-shutdown-script.plist
  • boot-shutdown.sh: bash shell script

# Install

You should customize the following placeholders inside the file boot-shutdown-script.plist:

  • BOOT.SHUTDOWN.SERVICE : If you don't know, leave it as is
  • SCRIPT_PATH : the path where the boot-shutdown.sh script is stored.
  • LOG_PATH : the path where the logs are stored. If you don't care about logs, use: /tmp

Then copy the file boot-shutdown-script.plist into /Library/LaunchDaemons/

sudo cp boot-shutdown-script.plist  /Library/LaunchDaemons/

When you want start the virtual machine type the following command:

sudo launchctl load -w /Library/LaunchDaemons/boot-shutdown-script.plist

If you want stop the script (and the you should type the following command:

sudo launchctl unload -w /Library/LaunchDaemons/boot-shutdown-script.plist

The script will be started machine at every host boot. Set into boot-shutdown-script.plist the field RunAtLoad to false if you don't want that the script starts automatically every time your mac os x boots. When RunAtLoad is set to false, after the load you must start and stop the script using the following command:

sudo launchctl start BOOT.SHUTDOWN.SERVICE
sudo launchctl stop BOOT.SHUTDOWN.SERVICE

Useful links




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap