Refactor: openHAB (#9060)
This commit is contained in:
parent
681932c491
commit
32cd65d5e1
@ -20,18 +20,18 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -f /etc/apt/sources.list.d/openhab.list ]]; then
|
if [[ ! -f /usr/lib/systemd/system/openhab.service ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
|
||||||
fi
|
|
||||||
msg_info "Updating ${APP} LXC"
|
|
||||||
$STD apt update
|
|
||||||
$STD apt -y upgrade
|
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
exit
|
||||||
|
fi
|
||||||
|
msg_info "Updating ${APP} LXC"
|
||||||
|
$STD apt update
|
||||||
|
$STD apt upgrade -y
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|||||||
@ -13,35 +13,30 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
|
||||||
$STD apt install -y \
|
|
||||||
ca-certificates \
|
|
||||||
apt-transport-https
|
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
JAVA_VERSION="21" setup_java
|
JAVA_VERSION="21" setup_java
|
||||||
|
|
||||||
msg_info "Installing openHAB"
|
msg_info "Installing openHAB"
|
||||||
curl -fsSL "https://openhab.jfrog.io/artifactory/api/gpg/key/public" | gpg --dearmor -o /usr/share/keyrings/openhab.gpg
|
setup_deb822_repo \
|
||||||
chmod u=rw,g=r,o=r /usr/share/keyrings/openhab.gpg
|
"openhab" \
|
||||||
cat <<EOF >/etc/apt/sources.list.d/openhab.sources
|
"https://openhab.jfrog.io/artifactory/api/gpg/key/public" \
|
||||||
Types: deb
|
"https://openhab.jfrog.io/artifactory/openhab-linuxpkg" \
|
||||||
URIs: https://openhab.jfrog.io/artifactory/openhab-linuxpkg
|
"stable" \
|
||||||
Suites: stable
|
"main"
|
||||||
Components: main
|
$STD apt install -y openhab
|
||||||
Signed-By: /usr/share/keyrings/openhab.gpg
|
msg_ok "Installed openHAB"
|
||||||
EOF
|
|
||||||
$STD apt update
|
msg_info "Initializing openHAB directories"
|
||||||
$STD apt -y install openhab
|
mkdir -p /var/lib/openhab/{tmp,etc,cache}
|
||||||
|
mkdir -p /etc/openhab
|
||||||
|
mkdir -p /var/log/openhab
|
||||||
|
chown -R openhab:openhab /var/lib/openhab /etc/openhab /var/log/openhab
|
||||||
|
msg_ok "Initialized openHAB directories"
|
||||||
|
|
||||||
|
msg_info "Starting Service"
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable -q --now openhab
|
systemctl enable -q --now openhab
|
||||||
msg_ok "Installed openHAB"
|
msg_ok "Started Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
cleanup_lxc
|
||||||
msg_info "Cleaning up"
|
|
||||||
$STD apt -y autoremove
|
|
||||||
$STD apt -y autoclean
|
|
||||||
$STD apt -y clean
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user