mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "bbf27909542b3ce05f5204729357e42777b8b454" and "6f2f334a81655cf80a474b68964cb9883c4d5c42" have entirely different histories.
bbf2790954
...
6f2f334a81
|
@ -2,13 +2,6 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## 2023-05-07
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- **FHEM LXC**
|
|
||||||
- NEW Script
|
|
||||||
|
|
||||||
## 2023-05-01
|
## 2023-05-01
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
69
ct/fhem.sh
69
ct/fhem.sh
|
@ -1,69 +0,0 @@
|
||||||
#!/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"
|
|
|
@ -52,10 +52,10 @@ function default_settings() {
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
if [[ ! -f /etc/apt/sources.list.d/homebridge.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
if [[ ! -d /var ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||||
msg_info "Updating ${APP} LXC"
|
msg_info "Updating ${APP} LXC"
|
||||||
apt-get update &>/dev/null
|
apt-get update &>/dev/null
|
||||||
apt-get install -y homebridge &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated Successfully"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
#!/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"
|
|
|
@ -18,19 +18,24 @@ $STD apt-get install -y curl
|
||||||
$STD apt-get install -y sudo
|
$STD apt-get install -y sudo
|
||||||
$STD apt-get install -y mc
|
$STD apt-get install -y mc
|
||||||
$STD apt-get install -y avahi-daemon
|
$STD apt-get install -y avahi-daemon
|
||||||
$STD apt-get install -y gnupg2
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up Homebridge Repository"
|
msg_info "Setting up Node.js Repository"
|
||||||
curl -sSf https://repo.homebridge.io/KEY.gpg | gpg --dearmor >/etc/apt/trusted.gpg.d/homebridge.gpg
|
$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
|
||||||
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/homebridge.gpg] https://repo.homebridge.io stable main' >/etc/apt/sources.list.d/homebridge.list
|
msg_ok "Set up Node.js Repository"
|
||||||
msg_ok "Set up Homebridge Repository"
|
|
||||||
|
msg_info "Installing Node.js"
|
||||||
|
$STD apt-get install -y nodejs gcc g++ make python net-tools
|
||||||
|
msg_ok "Installed Node.js"
|
||||||
|
|
||||||
msg_info "Installing Homebridge"
|
msg_info "Installing Homebridge"
|
||||||
$STD apt update
|
$STD npm install -g --unsafe-perm homebridge homebridge-config-ui-x
|
||||||
$STD apt-get install -y homebridge
|
|
||||||
msg_info "Installed Homebridge"
|
msg_info "Installed Homebridge"
|
||||||
|
|
||||||
|
msg_info "Creating Service"
|
||||||
|
$STD hb-service install --user homebridge
|
||||||
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
root
|
root
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,12 @@ cat <<"EOF"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
RD=$(echo "\033[01;31m")
|
|
||||||
YW=$(echo "\033[33m")
|
YW=$(echo "\033[33m")
|
||||||
GN=$(echo "\033[1;92m")
|
GN=$(echo "\033[1;92m")
|
||||||
CL=$(echo "\033[m")
|
CL=$(echo "\033[m")
|
||||||
BFR="\\r\\033[K"
|
BFR="\\r\\033[K"
|
||||||
HOLD="-"
|
HOLD="-"
|
||||||
CM="${GN}✓${CL}"
|
CM="${GN}✓${CL}"
|
||||||
CROSS="${RD}✗${CL}"
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
shopt -s inherit_errexit nullglob
|
shopt -s inherit_errexit nullglob
|
||||||
|
@ -45,20 +43,6 @@ msg_ok() {
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_error() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
msg_info "Checking CPU Vendor"
|
|
||||||
cpu=$(lscpu | grep -oP 'Vendor ID:\s*\K\S+')
|
|
||||||
if [ "$cpu" == "GenuineIntel" ]; then
|
|
||||||
msg_ok "${cpu} was detected"
|
|
||||||
else
|
|
||||||
msg_error "${cpu} is not supported"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Installing iucode-tool: a tool for updating Intel processor microcode"
|
msg_info "Installing iucode-tool: a tool for updating Intel processor microcode"
|
||||||
apt-get install -y iucode-tool &>/dev/null
|
apt-get install -y iucode-tool &>/dev/null
|
||||||
msg_ok "Installed iucode-tool"
|
msg_ok "Installed iucode-tool"
|
||||||
|
|
|
@ -1,111 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# Copyright (c) 2021-2023 tteck
|
|
||||||
# Author: tteck (tteckster)
|
|
||||||
# License: MIT
|
|
||||||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
||||||
|
|
||||||
clear
|
|
||||||
while true; do
|
|
||||||
read -p "Install the latest Processor Microcode (y/n)?" yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]*) break ;;
|
|
||||||
[Nn]*) exit ;;
|
|
||||||
*) echo "Please answer yes or no." ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
clear
|
|
||||||
cat <<"EOF"
|
|
||||||
____ __ ____ __
|
|
||||||
/ __ \_________ ________ ______________ _____ / |/ (_)_____________ _________ ____/ /__
|
|
||||||
/ /_/ / ___/ __ \/ ___/ _ \/ ___/ ___/ __ \/ ___/ / /|_/ / / ___/ ___/ __ \/ ___/ __ \/ __ / _ \
|
|
||||||
/ ____/ / / /_/ / /__/ __(__ |__ ) /_/ / / / / / / / /__/ / / /_/ / /__/ /_/ / /_/ / __/
|
|
||||||
/_/ /_/ \____/\___/\___/____/____/\____/_/ /_/ /_/_/\___/_/ \____/\___/\____/\__,_/\___/
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
RD=$(echo "\033[01;31m")
|
|
||||||
YW=$(echo "\033[33m")
|
|
||||||
GN=$(echo "\033[1;92m")
|
|
||||||
CL=$(echo "\033[m")
|
|
||||||
BFR="\\r\\033[K"
|
|
||||||
HOLD="-"
|
|
||||||
CM="${GN}✓${CL}"
|
|
||||||
CROSS="${RD}✗${CL}"
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
shopt -s inherit_errexit nullglob
|
|
||||||
|
|
||||||
msg_info() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
|
||||||
}
|
|
||||||
|
|
||||||
msg_ok() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
msg_error() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
intel() {
|
|
||||||
msg_info "Installing iucode-tool: a tool for updating Intel processor microcode"
|
|
||||||
apt-get install -y iucode-tool &>/dev/null
|
|
||||||
msg_ok "Installed iucode-tool"
|
|
||||||
|
|
||||||
msg_info "Downloading the latest Intel Processor Microcode Package for Linux"
|
|
||||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/i/intel-microcode/intel-microcode_3.20230214.1_amd64.deb
|
|
||||||
msg_ok "Downloaded the latest Intel Processor Microcode Package"
|
|
||||||
|
|
||||||
msg_info "Installing the Intel Processor Microcode (Patience)"
|
|
||||||
dpkg -i intel-microcode_3.20230214.1_amd64.deb &>/dev/null
|
|
||||||
msg_ok "Installed the Intel Processor Microcode"
|
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
|
||||||
rm intel-microcode_3.20230214.1_amd64.deb
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|
||||||
echo -e "\n To apply the changes, the system will need to be rebooted.\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
amd() {
|
|
||||||
msg_info "Installing amd-ucode: a tool for updating AMD processor microcode"
|
|
||||||
apt-get install -y amd-ucode &>/dev/null
|
|
||||||
msg_ok "Installed amd-ucode"
|
|
||||||
|
|
||||||
msg_info "Downloading the latest AMD Processor Microcode Package for Linux"
|
|
||||||
wget -q http://ftp.debian.org/debian/pool/non-free-firmware/a/amd64-microcode/amd64-microcode_3.20230414.1_amd64.deb
|
|
||||||
msg_ok "Downloaded the latest AMD Processor Microcode Package"
|
|
||||||
|
|
||||||
msg_info "Installing the AMD Processor Microcode (Patience)"
|
|
||||||
dpkg -i amd64-microcode_3.20230414.1_amd64.deb &>/dev/null
|
|
||||||
msg_ok "Installed the AMD Processor Microcode"
|
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
|
||||||
rm amd64-microcode_3.20230414.1_amd64.deb
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|
||||||
echo -e "\n To apply the changes, the system will need to be rebooted.\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ $(pveversion | grep -c "pve-manager/7\.[0-9]") -eq 0 ]; then
|
|
||||||
echo -e "${CROSS} Proxmox Virtual Environment Not Detected"
|
|
||||||
echo -e "Exiting..."
|
|
||||||
sleep 2
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Checking CPU Vendor"
|
|
||||||
cpu=$(lscpu | grep -oP 'Vendor ID:\s*\K\S+')
|
|
||||||
if [ "$cpu" == "GenuineIntel" ]; then
|
|
||||||
msg_ok "${cpu} was detected"
|
|
||||||
intel
|
|
||||||
elif [ "$cpu" == "AuthenticAMD" ]; then
|
|
||||||
msg_ok "${cpu} was detected"
|
|
||||||
amd
|
|
||||||
else
|
|
||||||
msg_error "${cpu} is not supported"
|
|
||||||
exit
|
|
||||||
fi
|
|
Loading…
Reference in New Issue