Update alpine-esphome-install.sh

correct openrc
This commit is contained in:
tteckster 2023-03-25 14:57:42 -04:00 committed by GitHub
parent 86ec03dc35
commit 642048fb6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,38 +27,21 @@ $STD apk add py3-pip
$STD pip3 install esphome $STD pip3 install esphome
$STD pip3 install tornado esptool $STD pip3 install tornado esptool
service_path="/etc/init.d/esphome"
echo "#!/sbin/openrc-run echo "#!/sbin/openrc-run
name=\"esphome\" description=\"ESPHome\"
description=\"ESPHome Dashboard\" pidfile=\"/run/esphome.pid\"
command=\"/usr/bin/esphome /root/config/ dashboard\"
command_user=\"root\"
command_background=true
pidfile=\"/run/\$name.pid\"
depend() {
need net
}
start_pre() {
checkpath --directory --mode 0755 /run/\$name
}
start() { start() {
ebegin \"Starting \$description\" esphome dashboard /root/esphome/config/ > /dev/null 2>&1 &
start-stop-daemon --start --quiet --background --exec /usr/bin/esphome -- /root/config/ dashboard echo \$! > \$pidfile
eend \$?
} }
stop() { stop() {
ebegin \"Stopping \$description\" kill \$(cat \$pidfile)
pkill esphome rm \$pidfile
eend \$? }" > /etc/init.d/esphome
}" > $service_path
chmod 755 $service_path chmod 755 /etc/init.d/esphome
$STD rc-update add esphome default rc-service -q esphome start
$STD /etc/init.d/esphome start rc-update add -q esphome default
msg_ok "Installed Alpine-ESPHome" msg_ok "Installed Alpine-ESPHome"
motd_ssh motd_ssh