Compare commits

..

7 Commits

Author SHA1 Message Date
tteckster bbf2790954
Create microcode2.sh
automatically identifies the processor vendor (Intel/AMD) and installs the appropriate microcode
2023-05-07 20:23:14 -04:00
tteckster 3486bba827
Update microcode.sh
add CPU Vendor check
2023-05-07 16:10:15 -04:00
tteckster 0d977e3881
Update CHANGELOG.MD 2023-05-07 16:00:20 -04:00
tteckster e52df1c02a
Update homebridge.sh
fix file check
2023-05-07 15:15:37 -04:00
tteckster 5fbe9ae884
Update homebridge.sh
fix update
2023-05-07 15:13:39 -04:00
Samuel Burkhard 78a34078ef
add fhem container script (#1400) 2023-05-07 15:04:08 -04:00
Samuel Burkhard 7cd2ca2970
Refactor homebridge lxc install (#1401)
* simplify homebridge install
2023-05-07 15:01:15 -04:00
7 changed files with 252 additions and 14 deletions

View File

@ -2,6 +2,13 @@
# Change Log
All notable changes to this project will be documented in this file.
## 2023-05-07
### Changed
- **FHEM LXC**
- NEW Script
## 2023-05-01
### Changed

69
ct/fhem.sh Normal file
View File

@ -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"

View File

@ -52,10 +52,10 @@ function default_settings() {
function update_script() {
header_info
if [[ ! -d /var ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if [[ ! -f /etc/apt/sources.list.d/homebridge.list ]]; 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
apt-get install -y homebridge &>/dev/null
msg_ok "Updated Successfully"
exit
}

40
install/fhem-install.sh Normal file
View File

@ -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"

View File

@ -18,24 +18,19 @@ $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 Node.js Repository"
$STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
msg_ok "Set up Node.js 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 "Setting up Homebridge Repository"
curl -sSf https://repo.homebridge.io/KEY.gpg | gpg --dearmor >/etc/apt/trusted.gpg.d/homebridge.gpg
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 Homebridge Repository"
msg_info "Installing Homebridge"
$STD npm install -g --unsafe-perm homebridge homebridge-config-ui-x
$STD apt update
$STD apt-get install -y homebridge
msg_info "Installed Homebridge"
msg_info "Creating Service"
$STD hb-service install --user homebridge
msg_ok "Created Service"
motd_ssh
root

View File

@ -23,12 +23,14 @@ 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
@ -43,6 +45,20 @@ msg_ok() {
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"
apt-get install -y iucode-tool &>/dev/null
msg_ok "Installed iucode-tool"

111
misc/microcode2.sh Normal file
View File

@ -0,0 +1,111 @@
#!/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