From 78a34078efd3701702e5dd191ca7f6fcf983a4e8 Mon Sep 17 00:00:00 2001 From: Samuel Burkhard Date: Sun, 7 May 2023 21:04:08 +0200 Subject: [PATCH] add fhem container script (#1400) --- ct/fhem.sh | 69 +++++++++++++++++++++++++++++++++++++++++ install/fhem-install.sh | 40 ++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 ct/fhem.sh create mode 100644 install/fhem-install.sh diff --git a/ct/fhem.sh b/ct/fhem.sh new file mode 100644 index 00000000..13c042d7 --- /dev/null +++ b/ct/fhem.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2023 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + ________ + / ____/ /_ ___ ____ ___ + / /_ / __ \/ _ \/ __ `__ \ + / __/ / / / / __/ / / / / / +/_/ /_/ /_/\___/_/ /_/ /_/ + +EOF +} +header_info +echo -e "Loading..." +APP="Fhem" +var_disk="8" +var_cpu="2" +var_ram="2048" +var_os="debian" +var_version="11" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET=dhcp + GATE="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +if [[ ! -f /etc/systemd/system/fhem.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_info "Updating ${APP} LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated Successfully" +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}:8083${CL} \n" diff --git a/install/fhem-install.sh b/install/fhem-install.sh new file mode 100644 index 00000000..caf99993 --- /dev/null +++ b/install/fhem-install.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2023 tteck +# 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 +$STD apt-get install -y avahi-daemon +$STD apt-get install -y gnupg2 +msg_ok "Installed Dependencies" + +msg_info "Setting up Fhem Repository" +curl -sSf https://debian.fhem.de/archive.key | gpg --dearmor >/etc/apt/trusted.gpg.d/debianfhemde-archive-keyring.gpg +echo 'deb [signed-by=/etc/apt/trusted.gpg.d/debianfhemde-archive-keyring.gpg] https://debian.fhem.de/nightly/ /' >/etc/apt/sources.list.d/fhem.list +msg_ok "Set up Fhem Repository" + +msg_info "Installing Fhem" +$STD apt-get update +$STD apt-get install -y fhem +msg_info "Installed Fhem" + +motd_ssh +root + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned"