2023-03-23 00:48:20 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-01 17:13:05 +00:00
|
|
|
# Copyright (c) 2021-2024 tteck
|
2023-03-23 00:48:20 +00:00
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
|
|
|
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
|
|
|
$STD apt-get install -y curl
|
|
|
|
$STD apt-get install -y sudo
|
|
|
|
$STD apt-get install -y mc
|
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
|
|
|
msg_info "Setting Phoscon Repository"
|
2023-07-08 14:56:20 +00:00
|
|
|
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
|
|
|
curl -fsSL http://phoscon.de/apt/deconz.pub.key >/etc/apt/trusted.gpg.d/deconz.pub.asc
|
|
|
|
echo "deb [arch=amd64] http://phoscon.de/apt/deconz $VERSION main" >/etc/apt/sources.list.d/deconz.list
|
2023-03-23 00:48:20 +00:00
|
|
|
msg_ok "Setup Phoscon Repository"
|
|
|
|
|
|
|
|
msg_info "Installing deConz"
|
2024-02-28 22:11:59 +00:00
|
|
|
libssl=$(curl -fsSL "http://security.ubuntu.com/ubuntu/pool/main/o/openssl/" | grep -o 'libssl1\.1_1\.1\.1f-1ubuntu2\.2[^"]*amd64\.deb' | head -n1)
|
|
|
|
wget -qL http://security.ubuntu.com/ubuntu/pool/main/o/openssl/$libssl
|
|
|
|
$STD dpkg -i $libssl
|
2023-03-23 00:48:20 +00:00
|
|
|
$STD apt-get update
|
|
|
|
$STD apt-get install -y deconz
|
|
|
|
msg_ok "Installed deConz"
|
|
|
|
|
|
|
|
msg_info "Creating Service"
|
2023-07-08 14:56:20 +00:00
|
|
|
cat <<EOF >/lib/systemd/system/deconz.service
|
|
|
|
[Unit]
|
2023-03-23 00:48:20 +00:00
|
|
|
Description=deCONZ: ZigBee gateway -- REST API
|
|
|
|
Wants=deconz-init.service deconz-update.service
|
|
|
|
StartLimitIntervalSec=0
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
User=root
|
|
|
|
ExecStart=/usr/bin/deCONZ -platform minimal --http-port=80
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=30
|
|
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_KILL CAP_SYS_BOOT CAP_SYS_TIME
|
|
|
|
|
|
|
|
[Install]
|
2023-07-08 14:56:20 +00:00
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
|
|
|
systemctl enable -q --now deconz
|
2023-03-23 00:48:20 +00:00
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 11:39:30 +00:00
|
|
|
customize
|
2023-03-23 00:48:20 +00:00
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2024-02-28 22:11:59 +00:00
|
|
|
rm -rf $libssl
|
2024-06-02 12:00:22 +00:00
|
|
|
$STD apt-get -y autoremove
|
|
|
|
$STD apt-get -y autoclean
|
2023-03-23 00:48:20 +00:00
|
|
|
msg_ok "Cleaned"
|