这是我群晖环境下的启动脚本(非chroot环境),在群晖计划任务中调用这个脚本即可启动chroot环境中的run_hass.sh启动脚本,就是下面这行,你改成你自己的就好了
nohup chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/home/homeassistant/run_hass.sh" >>/volume1/home-assistant.log 2>>/volume1/home-assistant2.log &
homeassistant.sh
#!/bin/sh case "$1" in
stop) echo "Stop HomeAssistant" pkill -f hass ;;
start) nohup chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/home/homeassistant/run_hass.sh" >>/volume1/home-assistant.log 2>>/volume1/home-assistant2.log & ;;
restart) $0 stop sleep 1 $0 start ;;
status) ps | grep homebridge return $? ;;
*) echo "usage: $0 { start | stop | restart | status}" >&2 exit 1 ;;
esac
|