Compare commits

...

2 Commits

Author SHA1 Message Date
tteckster 6c155c7463
Update ersatztv.sh
Refactor `function update_script ()`
fixes https://github.com/tteck/Proxmox/issues/3404
2024-07-20 12:44:27 -04:00
tteckster 2febf2c39b
Update unifi.sh
add AVX instruction set check
2024-07-20 06:20:20 -04:00
2 changed files with 10 additions and 8 deletions

View File

@ -57,22 +57,20 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/ErsatzTV ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/ErsatzTV ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
msg_info "Stopping ErsatzTV" msg_info "Stopping ErsatzTV"
systemctl stop ersatzTV systemctl stop ersatzTV
msg_ok "Stopped ErsatzTV" msg_ok "Stopped ErsatzTV"
msg_info "Updating ErsatzTV" msg_info "Updating ErsatzTV"
RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1) RELEASE=$(curl -s https://api.github.com/repos/ErsatzTV/ErsatzTV/releases | grep -oP '"tag_name": "\K[^"]+' | head -n 1)
if [ -d /opt/ErsatzTV/ErsatzTV_bak ]; then cp -R /opt/ErsatzTV/ ErsatzTV-backup
rm -rf /opt/ErsatzTV/ErsatzTV_bak rm ErsatzTV-backup/ErsatzTV
fi rm -rf /opt/ErsatzTV
mv /opt/ErsatzTV/ErsatzTV /opt/ErsatzTV/ErsatzTV_bak
wget -qO- "https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz" | tar -xz -C /opt wget -qO- "https://github.com/ErsatzTV/ErsatzTV/releases/download/${RELEASE}/ErsatzTV-${RELEASE}-linux-x64.tar.gz" | tar -xz -C /opt
mv "/opt/ErsatzTV-${RELEASE}-linux-x64" /opt/ErsatzTV mv "/opt/ErsatzTV-${RELEASE}-linux-x64" /opt/ErsatzTV
cp -R ErsatzTV-backup/* /opt/ErsatzTV/
rm -rf ErsatzTV-backup
msg_ok "Updated ErsatzTV" msg_ok "Updated ErsatzTV"
msg_info "Starting ErsatzTV" msg_info "Starting ErsatzTV"

View File

@ -17,6 +17,10 @@ cat <<"EOF"
EOF EOF
} }
header_info header_info
if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
echo "AVX instruction set is not supported on this CPU."
exit
fi
echo -e "Loading..." echo -e "Loading..."
APP="Unifi" APP="Unifi"
var_disk="8" var_disk="8"