2023-03-25 13:08:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Copyright (c) 2021-2023 tteck
|
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
2023-03-25 21:30:25 +00:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2023-03-25 13:08:07 +00:00
|
|
|
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
|
|
|
$STD apk add newt
|
|
|
|
$STD apk add curl
|
|
|
|
$STD apk add openssh
|
|
|
|
$STD apk add nano
|
|
|
|
$STD apk add mc
|
|
|
|
$STD apk add git
|
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2023-03-25 19:07:06 +00:00
|
|
|
msg_info "Installing pip3 Package Manager"
|
2023-03-25 13:08:07 +00:00
|
|
|
$STD apk add py3-pip
|
2023-03-25 19:07:06 +00:00
|
|
|
msg_ok "Installed pip3 Package Manager"
|
|
|
|
|
|
|
|
msg_info "Installing Alpine-ESPHome"
|
2023-03-25 13:08:07 +00:00
|
|
|
$STD pip3 install esphome
|
|
|
|
$STD pip3 install tornado esptool
|
|
|
|
|
2023-03-25 15:49:10 +00:00
|
|
|
echo "#!/sbin/openrc-run
|
2023-03-25 18:57:42 +00:00
|
|
|
description=\"ESPHome\"
|
|
|
|
pidfile=\"/run/esphome.pid\"
|
2023-03-25 13:08:07 +00:00
|
|
|
start() {
|
2023-03-25 18:57:42 +00:00
|
|
|
esphome dashboard /root/esphome/config/ > /dev/null 2>&1 &
|
|
|
|
echo \$! > \$pidfile
|
2023-03-25 13:08:07 +00:00
|
|
|
}
|
|
|
|
stop() {
|
2023-03-25 18:57:42 +00:00
|
|
|
kill \$(cat \$pidfile)
|
|
|
|
rm \$pidfile
|
2023-03-25 21:30:25 +00:00
|
|
|
}" >/etc/init.d/esphome
|
2023-03-25 13:08:07 +00:00
|
|
|
|
2023-03-25 18:57:42 +00:00
|
|
|
chmod 755 /etc/init.d/esphome
|
|
|
|
rc-service -q esphome start
|
|
|
|
rc-update add -q esphome default
|
2023-03-25 13:08:07 +00:00
|
|
|
msg_ok "Installed Alpine-ESPHome"
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
root
|