mirror of
https://github.com/tteck/Proxmox.git
synced 2025-02-15 06:09:15 +01:00
parent
e7ec3d0275
commit
8e331fcbff
155 changed files with 12962 additions and 11552 deletions
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
echo -e "\e[1;33mThis script will add Tailscale to an existing LXC Container ONLY\e[0m"
|
||||
while true; do
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
set -o errexit
|
||||
|
@ -32,7 +32,7 @@ function msg() {
|
|||
|
||||
CTID=$1
|
||||
CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
||||
cat <<EOF >> $CTID_CONFIG_PATH
|
||||
cat <<EOF >>$CTID_CONFIG_PATH
|
||||
lxc.cgroup2.devices.allow: c 10:200 rwm
|
||||
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
|
||||
EOF
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -21,25 +21,25 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
|
|||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
echo -e "${BL}
|
||||
______ __ _____
|
||||
/ ____/___ ____/ /__ / ___/___ ______ _____ _____
|
||||
/ / / __ \/ __ / _ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
|
||||
|
@ -66,9 +66,9 @@ apt-get install -y sudo &>/dev/null
|
|||
apt-get install -y git &>/dev/null
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
VERSION=$(curl -s https://api.github.com/repos/coder/code-server/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 3, length($2)-4) }') \
|
||||
VERSION=$(curl -s https://api.github.com/repos/coder/code-server/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
msg_info "Installing Code-Server v${VERSION}"
|
||||
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server_${VERSION}_amd64.deb &>/dev/null
|
||||
|
@ -76,7 +76,7 @@ sudo dpkg -i code-server_${VERSION}_amd64.deb &>/dev/null
|
|||
rm -rf code-server_${VERSION}_amd64.deb
|
||||
mkdir -p ~/.config/code-server/
|
||||
sudo systemctl enable --now code-server@$USER &>/dev/null
|
||||
cat <<EOF > ~/.config/code-server/config.yaml
|
||||
cat <<EOF >~/.config/code-server/config.yaml
|
||||
bind-addr: 0.0.0.0:8680
|
||||
auth: none
|
||||
password:
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
clear
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -15,14 +15,14 @@ APP="Home Assistant Container"
|
|||
while true; do
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
__ __ ___ _ __ __
|
||||
/ / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_
|
||||
/ /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/
|
||||
|
@ -46,10 +46,12 @@ function msg_error() {
|
|||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then msg_error "No backups found! \n"; exit 1; fi
|
||||
if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
fi
|
||||
DIR=/var/lib/docker/volumes/hass_config/_data/restore
|
||||
if [ -d "$DIR" ];
|
||||
then
|
||||
if [ -d "$DIR" ]; then
|
||||
msg_ok "Restore Directory Exists."
|
||||
else
|
||||
mkdir -p /var/lib/docker/volumes/hass_config/_data/restore
|
||||
|
@ -58,7 +60,10 @@ fi
|
|||
cd /var/lib/docker/volumes/hass_config/_data/backups/
|
||||
PS3="Please enter your choice: "
|
||||
files="$(ls -A .)"
|
||||
select filename in ${files}; do msg_ok "You selected ${BL}${filename}${CL}"; break; done
|
||||
select filename in ${files}; do
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
done
|
||||
msg_info "Stopping Home Assistant"
|
||||
docker stop homeassistant &>/dev/null
|
||||
msg_ok "Stopped Home Assistant"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
clear
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -15,14 +15,14 @@ APP="Home Assistant Core"
|
|||
while true; do
|
||||
read -p "This will restore ${APP} from a backup. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
__ __ ___ _ __ __ ______
|
||||
/ / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_ / ____/___ ________
|
||||
/ /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/ / / / __ \/ ___/ _ \
|
||||
|
@ -46,10 +46,12 @@ function msg_error() {
|
|||
local msg="$1"
|
||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then msg_error "No backups found! \n"; exit 1; fi
|
||||
if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then
|
||||
msg_error "No backups found! \n"
|
||||
exit 1
|
||||
fi
|
||||
DIR=/root/.homeassistant/restore
|
||||
if [ -d "$DIR" ];
|
||||
then
|
||||
if [ -d "$DIR" ]; then
|
||||
msg_ok "Restore Directory Exists."
|
||||
else
|
||||
mkdir -p /root/.homeassistant/restore
|
||||
|
@ -58,7 +60,10 @@ fi
|
|||
cd /root/.homeassistant/backups/
|
||||
PS3="Please enter your choice: "
|
||||
files="$(ls -A .)"
|
||||
select filename in ${files}; do msg_ok "You selected ${BL}${filename}${CL}"; break; done
|
||||
select filename in ${files}; do
|
||||
msg_ok "You selected ${BL}${filename}${CL}"
|
||||
break
|
||||
done
|
||||
msg_info "Stopping Home Assistant"
|
||||
sudo service homeassistant stop
|
||||
msg_ok "Stopped Home Assistant"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -20,25 +20,25 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
|
|||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
echo -e "${BL}
|
||||
_____ _ _____
|
||||
/ ____| | |/ ____|
|
||||
| | _ __ _____ ____| | (___ ___ ___
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
clear
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
while true; do
|
||||
read -p "This will Update Dashy LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${RD}
|
||||
echo -e "${RD}
|
||||
_____ _
|
||||
| __ \ | |
|
||||
| | | | __ _ ___| |__ _ _
|
||||
|
|
|
@ -2,26 +2,26 @@
|
|||
# bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/edge-kernel.sh)"
|
||||
set -e
|
||||
KERNEL_ON=$(uname -r)
|
||||
PVE_KERNEL=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print substr($2, 12, length($2)-1) }' | tac | head -n 1)
|
||||
EDGE_KERNEL=$(dpkg --list| grep 'kernel-.*-edge' | awk '{print substr($2, 12, length($2)-1) }' | tac | head -n 1)
|
||||
PVE_KERNEL=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print substr($2, 12, length($2)-1) }' | tac | head -n 1)
|
||||
EDGE_KERNEL=$(dpkg --list | grep 'kernel-.*-edge' | awk '{print substr($2, 12, length($2)-1) }' | tac | head -n 1)
|
||||
clear
|
||||
while true; do
|
||||
read -p "This is a Proxmox Edge Kernel Tool, USE AT YOUR OWN RISK. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
|
||||
show_menu(){
|
||||
normal=`echo "\033[m"`
|
||||
safe=`echo "\033[32m"`
|
||||
menu=`echo "\033[36m"`
|
||||
number=`echo "\033[33m"`
|
||||
bgred=`echo "\033[41m"`
|
||||
fgred=`echo "\033[31m"`
|
||||
show_menu() {
|
||||
normal=$(echo "\033[m")
|
||||
safe=$(echo "\033[32m")
|
||||
menu=$(echo "\033[36m")
|
||||
number=$(echo "\033[33m")
|
||||
bgred=$(echo "\033[41m")
|
||||
fgred=$(echo "\033[31m")
|
||||
proxmox-boot-tool kernel list
|
||||
echo -e "\nCurrent Kernel: ${menu}${KERNEL_ON}${normal}"
|
||||
printf "\n${menu}*********************************************${normal}\n"
|
||||
|
@ -34,106 +34,113 @@ show_menu(){
|
|||
printf "Please choose an option from the menu and enter or ${fgred}x${normal} to exit."
|
||||
read opt
|
||||
}
|
||||
option_picked(){
|
||||
msgcolor=`echo "\033[01;31m"`
|
||||
normal=`echo "\033[00;00m"`
|
||||
option_picked() {
|
||||
msgcolor=$(echo "\033[01;31m")
|
||||
normal=$(echo "\033[00;00m")
|
||||
message=${@:-"${normal}Error: No message passed"}
|
||||
printf "${msgcolor}${message}${normal}\n"
|
||||
}
|
||||
clear
|
||||
show_menu
|
||||
while [ $opt != '' ]
|
||||
do
|
||||
while [ $opt != '' ]; do
|
||||
if [ $opt = '' ]; then
|
||||
exit;
|
||||
exit
|
||||
else
|
||||
case $opt in
|
||||
1) while true; do
|
||||
read -p "Are you sure you want to Install Proxmox Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear;
|
||||
option_picked "Installing Proxmox Edge Kernel & Rebooting";
|
||||
case $opt in
|
||||
1)
|
||||
while true; do
|
||||
read -p "Are you sure you want to Install Proxmox Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
option_picked "Installing Proxmox Edge Kernel & Rebooting"
|
||||
apt-get install -y gnupg
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/pve-edge/kernel/gpg.8EC01CCF309B98E7.key' | apt-key add -
|
||||
echo "deb https://dl.cloudsmith.io/public/pve-edge/kernel/deb/debian bullseye main" > /etc/apt/sources.list.d/pve-edge-kernel.list
|
||||
echo "deb https://dl.cloudsmith.io/public/pve-edge/kernel/deb/debian bullseye main" >/etc/apt/sources.list.d/pve-edge-kernel.list
|
||||
apt-get -y update
|
||||
apt-get -y install pve-kernel-5.19-edge
|
||||
reboot
|
||||
break;
|
||||
;;
|
||||
2) while true; do
|
||||
read -p "Are you sure you want to Switch to Proxmox VE 7 ${PVE_KERNEL} Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear;
|
||||
option_picked "Switching to Proxmox VE 7 Kernel & Rebooting";
|
||||
break
|
||||
;;
|
||||
2)
|
||||
while true; do
|
||||
read -p "Are you sure you want to Switch to Proxmox VE 7 ${PVE_KERNEL} Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
option_picked "Switching to Proxmox VE 7 Kernel & Rebooting"
|
||||
proxmox-boot-tool kernel pin ${PVE_KERNEL}
|
||||
reboot
|
||||
break;
|
||||
;;
|
||||
3) while true; do
|
||||
read -p "Are you sure you want to Switch to Proxmox ${EDGE_KERNEL} Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear;
|
||||
option_picked "Switching to Proxmox Edge Kernel & Rebooting";
|
||||
break
|
||||
;;
|
||||
3)
|
||||
while true; do
|
||||
read -p "Are you sure you want to Switch to Proxmox ${EDGE_KERNEL} Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
option_picked "Switching to Proxmox Edge Kernel & Rebooting"
|
||||
proxmox-boot-tool kernel pin ${EDGE_KERNEL}
|
||||
reboot
|
||||
break;
|
||||
;;
|
||||
4) while true; do
|
||||
read -p "Are you sure you want to Unpin the Current Kernel? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear;
|
||||
option_picked "Unpinning Current Kernel";
|
||||
break
|
||||
;;
|
||||
4)
|
||||
while true; do
|
||||
read -p "Are you sure you want to Unpin the Current Kernel? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
option_picked "Unpinning Current Kernel"
|
||||
proxmox-boot-tool kernel unpin
|
||||
clear;
|
||||
break;
|
||||
;;
|
||||
5) while true; do
|
||||
read -p "Are you sure you want to Remove Proxmox Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear;
|
||||
option_picked "Removing Proxmox Edge Kernel & Rebooting";
|
||||
clear
|
||||
break
|
||||
;;
|
||||
5)
|
||||
while true; do
|
||||
read -p "Are you sure you want to Remove Proxmox Edge Kernel & Reboot? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
option_picked "Removing Proxmox Edge Kernel & Rebooting"
|
||||
apt-get purge -y ${EDGE_KERNEL}
|
||||
rm -rf /etc/apt/sources.list.d/pve-edge-kernel.list
|
||||
proxmox-boot-tool kernel unpin
|
||||
reboot
|
||||
break;
|
||||
;;
|
||||
x)exit;
|
||||
;;
|
||||
\n)exit;
|
||||
;;
|
||||
*)clear;
|
||||
option_picked "Please choose an option from the menu";
|
||||
show_menu;
|
||||
;;
|
||||
esac
|
||||
break
|
||||
;;
|
||||
x)
|
||||
exit
|
||||
;;
|
||||
\n)
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
option_picked "Please choose an option from the menu"
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
show_menu
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
LATEST=$(curl -sL https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -14,14 +14,14 @@ APP="Emby"
|
|||
while true; do
|
||||
read -p "This will Update ${APP} to ${LATEST}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
______ __
|
||||
/ ____/___ ___ / /_ __ __
|
||||
/ __/ / __ __ \/ __ \/ / / /
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -21,25 +21,25 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
|
|||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${DGN}
|
||||
echo -e "${DGN}
|
||||
|
||||
______ _ _ ____
|
||||
| ____(_) | | _ \
|
||||
|
@ -81,7 +81,7 @@ WorkingDirectory=/root/
|
|||
ExecStart=/usr/local/bin/filebrowser -r /
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target" > $service_path
|
||||
WantedBy=default.target" >$service_path
|
||||
|
||||
systemctl enable --now filebrowser.service &>/dev/null
|
||||
msg_ok "Created Service"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
echo -e "\e[1;33m This script will Prepare a LXC Container for Frigate \e[0m"
|
||||
while true; do
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -48,7 +48,7 @@ for char_dev in ${CHAR_DEVS[@]}; do
|
|||
CHAR_DEV_STRING+=" -regex \".*/${char_dev}\""
|
||||
done
|
||||
|
||||
read -r -d '' HOOK_SCRIPT <<- EOF || true
|
||||
read -r -d '' HOOK_SCRIPT <<-EOF || true
|
||||
for char_dev in \$(find /sys/dev/char -regextype sed $CHAR_DEV_STRING); do
|
||||
dev="/dev/\$(sed -n "/DEVNAME/ s/^.*=\(.*\)$/\1/p" \${char_dev}/uevent)";
|
||||
mkdir -p \$(dirname \${LXC_ROOTFS_MOUNT}\${dev});
|
||||
|
@ -66,7 +66,7 @@ CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
|||
sed '/autodev/d' $CTID_CONFIG_PATH >CTID.conf
|
||||
cat CTID.conf >$CTID_CONFIG_PATH
|
||||
|
||||
cat <<EOF >> $CTID_CONFIG_PATH
|
||||
cat <<EOF >>$CTID_CONFIG_PATH
|
||||
lxc.autodev: 1
|
||||
lxc.hook.autodev: bash -c '$HOOK_SCRIPT'
|
||||
EOF
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/ha-copy-data-podman.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant LXC to a Podman Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Home Assistant LXC to a Podman Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -58,28 +58,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Podman LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Podman LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.02.12" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -90,13 +90,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/
|
||||
PODMAN_PATH=/var/lib/containers/storage/volumes/hass_config/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${PODMAN_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${PODMAN_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
rm -rf ${CTID_TO_PATH}${PODMAN_PATH}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/ha-copy-data.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Home Assistant LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from one Home Assistant LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -58,28 +58,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.01.23" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -89,13 +89,13 @@ if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then
|
|||
fi
|
||||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
rm -rf ${CTID_TO_PATH}${DOCKER_PATH}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Container LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Home Assistant Container LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -55,28 +55,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Container LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Container LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Core LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Core LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.10.02" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -87,13 +87,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/_data
|
||||
CORE_PATH=/root/.homeassistant
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${CORE_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${CORE_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
msg "Copying Data..."
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Container LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Container LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -55,28 +55,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Core LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Core LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Container LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Container LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.10.02" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -87,13 +87,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/_data
|
||||
CORE_PATH=/root/.homeassistant
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
msg "Copying Data..."
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
clear
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Home Assistant Core LXC to a Home Assistant Core LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -51,28 +51,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Core LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Core LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Core LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Core LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.10.03" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -83,13 +83,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/_data
|
||||
CORE_PATH=/root/.homeassistant
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${CORE_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${CORE_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${CORE_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
msg "Copying Data..."
|
||||
|
|
|
@ -4,9 +4,9 @@ echo -e "\e[1;33m This script will install Home Assistant Community Store (HACS)
|
|||
while true; do
|
||||
read -p "Start the HACS Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ echo -e "\e[1;33m This script will install Home Assistant Community Store (HACS)
|
|||
while true; do
|
||||
read -p "Start the HACS Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
PP=`echo "\e[1;35m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
PP=$(echo "\e[1;35m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
while true; do
|
||||
read -p "This will Update Heimdall Dashboard. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "This will Update Heimdall Dashboard. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${PP}
|
||||
echo -e "${PP}
|
||||
_ _ _ _ _ _ _____ _ _ _
|
||||
| | | | (_) | | | | | | __ \ | | | | | |
|
||||
| |__| | ___ _ _ __ ___ __| | __ _| | | | | | | __ _ ___| |__ | |__ ___ __ _ _ __ __| |
|
||||
|
@ -39,13 +39,13 @@ echo -en "${GN} Backing up Data... "
|
|||
if [ -d "/opt/Heimdall-2.4.6" ]; then
|
||||
cp -R /opt/Heimdall-2.4.6/database database-backup
|
||||
cp -R /opt/Heimdall-2.4.6/public public-backup
|
||||
elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
|
||||
elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
|
||||
cp -R /opt/Heimdall-2.4.7b/database database-backup
|
||||
cp -R /opt/Heimdall-2.4.7b/public public-backup
|
||||
elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
|
||||
elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
|
||||
cp -R /opt/Heimdall-2.4.8/database database-backup
|
||||
cp -R /opt/Heimdall-2.4.8/public public-backup
|
||||
else
|
||||
else
|
||||
cp -R /opt/Heimdall/database database-backup
|
||||
cp -R /opt/Heimdall/public public-backup
|
||||
fi
|
||||
|
@ -56,13 +56,13 @@ RELEASE=$(curl -sX GET "https://api.github.com/repos/linuxserver/Heimdall/releas
|
|||
echo -en "${GN} Updating Heimdall Dashboard to ${RELEASE}... "
|
||||
curl --silent -o ${RELEASE}.tar.gz -L "https://github.com/linuxserver/Heimdall/archive/${RELEASE}.tar.gz" &>/dev/null
|
||||
tar xvzf ${RELEASE}.tar.gz &>/dev/null
|
||||
VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 3, length($2)-4) }')
|
||||
VER=$(curl -s https://api.github.com/repos/linuxserver/Heimdall/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
if [ ! -d "/opt/Heimdall" ]; then
|
||||
mv Heimdall-${VER} /opt/Heimdall
|
||||
else
|
||||
mv Heimdall-${VER} /opt/Heimdall
|
||||
else
|
||||
cp -R Heimdall-${VER}/* /opt/Heimdall
|
||||
fi
|
||||
echo -e "${CM}${CL} \r"
|
||||
|
@ -82,7 +82,7 @@ ExecStart="/usr/bin/php" artisan serve --port 7990 --host 0.0.0.0
|
|||
TimeoutStopSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target" > $service_path
|
||||
WantedBy=multi-user.target" >$service_path
|
||||
|
||||
echo -en "${GN} Restoring Data... "
|
||||
cp -R database-backup/* /opt/Heimdall/database
|
||||
|
@ -94,10 +94,10 @@ echo -en "${GN} Cleanup... "
|
|||
if [ -d "/opt/Heimdall-2.4.6" ]; then
|
||||
rm -rf /opt/Heimdall-2.4.6
|
||||
rm -rf /opt/v2.4.6.tar.gz
|
||||
elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
|
||||
elif [[ -d "/opt/Heimdall-2.4.7b" ]]; then
|
||||
rm -rf /opt/Heimdall-2.4.7b
|
||||
rm -rf /opt/v2.4.7b.tar.gz
|
||||
elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
|
||||
elif [[ -d "/opt/Heimdall-2.4.8" ]]; then
|
||||
rm -rf /opt/Heimdall-2.4.8
|
||||
rm -rf /opt/v2.4.8.tar.gz
|
||||
fi
|
||||
|
@ -116,4 +116,3 @@ sleep 2
|
|||
echo -e "${CM}${CL} \r"
|
||||
|
||||
echo -en "${GN} Finished! ${CL}\n"
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -19,25 +19,25 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
|
|||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
while true; do
|
||||
read -p "This will Update ${APP}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
__ __
|
||||
/ / / /___ ____ ___ ___ ____ ____ _____ ____
|
||||
/ /_/ / __ \/ __ `__ \/ _ \/ __ \/ __ `/ __ `/ _ \
|
||||
|
@ -61,10 +61,10 @@ function msg_ok() {
|
|||
|
||||
msg_info "Updating ${APP}"
|
||||
if ! command -v pnpm >/dev/null 2>&1; then
|
||||
npm install -g pnpm &>/dev/null
|
||||
npm install -g pnpm &>/dev/null
|
||||
fi
|
||||
cd /opt/homepage
|
||||
systemctl stop homepage
|
||||
cd /opt/homepage
|
||||
systemctl stop homepage
|
||||
git pull --force &>/dev/null
|
||||
pnpm install &>/dev/null
|
||||
pnpm build &>/dev/null
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -18,15 +18,15 @@ current_kernel=$(uname -r)
|
|||
while true; do
|
||||
read -p "This will Clean Unused Kernel Images, USE AT YOUR OWN RISK. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo -e "${RD}Please answer y/n${CL}";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo -e "${RD}Please answer y/n${CL}" ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
|
||||
function header_info {
|
||||
echo -e "${RD}
|
||||
echo -e "${RD}
|
||||
_ __ _ _____ _
|
||||
| |/ / | | / ____| |
|
||||
| / ___ _ __ _ __ ___| | | | | | ___ __ _ _ __
|
||||
|
@ -48,29 +48,29 @@ function msg_ok() {
|
|||
}
|
||||
|
||||
function check_root() {
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "${CROSS}${RD}Error: This script must be ran as the root user.\n${CL}"
|
||||
exit 1
|
||||
else
|
||||
header_info
|
||||
edge_kernel
|
||||
kernel_info
|
||||
kernel_clean
|
||||
fi
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "${CROSS}${RD}Error: This script must be ran as the root user.\n${CL}"
|
||||
exit 1
|
||||
else
|
||||
header_info
|
||||
edge_kernel
|
||||
kernel_info
|
||||
kernel_clean
|
||||
fi
|
||||
}
|
||||
|
||||
function edge_kernel() {
|
||||
if [[ "$current_kernel" == *"edge"* ]]; then
|
||||
echo -e "\n${CROSS} ${RD}ERROR:${CL} Proxmox ${BL}${current_kernel}${CL} Kernel Active"
|
||||
echo -e "\nAn Active PVE Kernel is required to use Kernel Clean\n"
|
||||
exit 1
|
||||
echo -e "\n${CROSS} ${RD}ERROR:${CL} Proxmox ${BL}${current_kernel}${CL} Kernel Active"
|
||||
echo -e "\nAn Active PVE Kernel is required to use Kernel Clean\n"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function kernel_info() {
|
||||
if [[ "$MODE" != "PBS" ]]; then
|
||||
echo -e "${YW}PVE Version: ${BL}$(pveversion)\n${CL}"
|
||||
fi
|
||||
if [[ "$MODE" != "PBS" ]]; then
|
||||
echo -e "${YW}PVE Version: ${BL}$(pveversion)\n${CL}"
|
||||
fi
|
||||
if [[ "$current_kernel" == *"pve"* ]]; then
|
||||
echo -e "${YW}Current Kernel: ${BL}$current_kernel\n${CL}"
|
||||
else
|
||||
|
@ -80,50 +80,49 @@ function kernel_info() {
|
|||
}
|
||||
|
||||
function kernel_clean() {
|
||||
kernels=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print $2}' | sort -V)
|
||||
kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | sort -V)
|
||||
remove_kernels=""
|
||||
for kernel in $kernels
|
||||
do
|
||||
for kernel in $kernels; do
|
||||
if [ "$(echo $kernel | grep $current_kernel)" ]; then
|
||||
break
|
||||
else
|
||||
echo -e "${BL}'$kernel' ${CL}${YW}has been added to the remove Kernel list\n${CL}"
|
||||
remove_kernels+=" $kernel"
|
||||
remove_kernels+=" $kernel"
|
||||
fi
|
||||
done
|
||||
msg_ok "Kernel Search Completed\n"
|
||||
msg_ok "Kernel Search Completed\n"
|
||||
if [[ "$remove_kernels" != *"pve"* ]]; then
|
||||
echo -e "${PARTY} ${GN}It appears there are no old Kernels on your system. \n${CL}"
|
||||
msg_info "Exiting"
|
||||
sleep 2
|
||||
msg_ok "Done"
|
||||
else
|
||||
read -p "Would you like to remove the $(echo $remove_kernels | awk '{print NF}') selected Kernels listed above? [y/n]: " -n 1 -r
|
||||
read -p "Would you like to remove the $(echo $remove_kernels | awk '{print NF}') selected Kernels listed above? [y/n]: " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
msg_info "Removing ${CL}${RD}$(echo $remove_kernels | awk '{print NF}') ${CL}${YW}old Kernels${CL}"
|
||||
/usr/bin/apt purge -y $remove_kernels > /dev/null 2>&1
|
||||
msg_ok "Successfully Removed Kernels"
|
||||
msg_info "Updating GRUB"
|
||||
/usr/sbin/update-grub > /dev/null 2>&1
|
||||
msg_ok "Successfully Updated GRUB"
|
||||
msg_info "Exiting"
|
||||
sleep 2
|
||||
msg_ok "Done"
|
||||
else
|
||||
msg_info "Exiting"
|
||||
sleep 2
|
||||
msg_ok "Done"
|
||||
fi
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
msg_info "Removing ${CL}${RD}$(echo $remove_kernels | awk '{print NF}') ${CL}${YW}old Kernels${CL}"
|
||||
/usr/bin/apt purge -y $remove_kernels >/dev/null 2>&1
|
||||
msg_ok "Successfully Removed Kernels"
|
||||
msg_info "Updating GRUB"
|
||||
/usr/sbin/update-grub >/dev/null 2>&1
|
||||
msg_ok "Successfully Updated GRUB"
|
||||
msg_info "Exiting"
|
||||
sleep 2
|
||||
msg_ok "Done"
|
||||
else
|
||||
msg_info "Exiting"
|
||||
sleep 2
|
||||
msg_ok "Done"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e " Switching to PBS mode"
|
||||
MODE="PBS"
|
||||
sleep 2
|
||||
else
|
||||
MODE="PVE"
|
||||
echo -e " Switching to PBS mode"
|
||||
MODE="PBS"
|
||||
sleep 2
|
||||
else
|
||||
MODE="PVE"
|
||||
fi
|
||||
|
||||
check_root
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
while true; do
|
||||
read -p "This will create a New Update Menu for Home Assistant Container LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
|
@ -13,19 +13,19 @@ set -o errexit
|
|||
rm -rf /root/update.sh update update-containers.sh
|
||||
echo -e "\e[1;92m Creating New Update Menu Script... \e[0m"
|
||||
if [ -f /usr/local/lib/python3.9/dist-packages/runlike/runlike.py ]; then
|
||||
echo -e "\e[1;92m pip3/runlike Already Installed! \e[0m"
|
||||
echo -e "\e[1;92m pip3/runlike Already Installed! \e[0m"
|
||||
else
|
||||
apt-get update &>/dev/null
|
||||
echo -e "\e[1;92m Installing pip3... \e[0m"
|
||||
apt-get install -y python3-pip &>/dev/null
|
||||
echo -e "\e[1;92m Installing runlike... \e[0m"
|
||||
pip3 install runlike &>/dev/null
|
||||
apt-get update &>/dev/null
|
||||
echo -e "\e[1;92m Installing pip3... \e[0m"
|
||||
apt-get install -y python3-pip &>/dev/null
|
||||
echo -e "\e[1;92m Installing runlike... \e[0m"
|
||||
pip3 install runlike &>/dev/null
|
||||
fi
|
||||
echo -e "\e[1;92m Creating Update Script... \e[0m"
|
||||
if [ -d /root/hass_config ]; then
|
||||
echo -e "\e[1;92m There's Already (hass_config) Folder! \e[0m"
|
||||
echo -e "\e[1;92m There's Already (hass_config) Folder! \e[0m"
|
||||
else
|
||||
mkdir /root/hass_config
|
||||
mkdir /root/hass_config
|
||||
fi
|
||||
UPDATE_PATH='/root/update'
|
||||
UPDATE_CONTAINERS_PATH='/root/update-containers.sh'
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 3, length($2)-4) }')
|
||||
RELEASE=$(curl -s https://api.github.com/repos/navidrome/navidrome/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
function update_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
_ __ _ __
|
||||
/ | / /___ __ __(_)___/ /________ ____ ___ ___
|
||||
/ |/ / __ / | / / / __ / ___/ __ \/ __ __ \/ _ \
|
||||
|
@ -23,9 +23,9 @@ update_info
|
|||
while true; do
|
||||
read -p "This will Update Navidrome to v$RELEASE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sleep 2
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -19,25 +19,25 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
|
|||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
while true; do
|
||||
read -p "This will Update ${APP}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${YW}
|
||||
echo -e "${YW}
|
||||
_ _ _____ ____
|
||||
| \ | | | __ \| _ \
|
||||
| \| | ___ v3___ ___ | | | | |_) |
|
||||
|
@ -68,18 +68,17 @@ msg_ok "Updated ${APP}"
|
|||
|
||||
read -p "${APP} LXC needs to reboot to apply the update. Reboot now? " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
reboot=yes
|
||||
else
|
||||
reboot=no
|
||||
fi
|
||||
|
||||
if [ "$reboot" == "yes" ]; then
|
||||
msg_info "Rebooting ${APP} LXC"
|
||||
reboot
|
||||
if [ "$reboot" == "yes" ]; then
|
||||
msg_info "Rebooting ${APP} LXC"
|
||||
reboot
|
||||
fi
|
||||
|
||||
if [ "$reboot" == "no" ]; then
|
||||
msg_ok "Finished Updating ${APP}. Reboot to apply the update."
|
||||
if [ "$reboot" == "no" ]; then
|
||||
msg_ok "Finished Updating ${APP}. Reboot to apply the update."
|
||||
fi
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/node-red-themes.sh)"
|
||||
set -o errexit
|
||||
show_menu(){
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
show_menu() {
|
||||
YW=$(echo "\033[33m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
echo -e "${RD} Backup your Node-Red flows before running this script!!${CL} \n "
|
||||
while true; do
|
||||
read -p "This will Install Node-Red Themes. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
echo -e "${RD} Backup your Node-Red flows before installing any theme!!${CL} \n "
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
echo -e "${RD} Backup your Node-Red flows before running this script!!${CL} \n "
|
||||
while true; do
|
||||
read -p "This will Install Node-Red Themes. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
echo -e "${RD} Backup your Node-Red flows before installing any theme!!${CL} \n "
|
||||
printf "\n${BL}*********************************************${CL}\n"
|
||||
printf "${BL}**${YW} 1)${GN} Default Theme ${CL}\n"
|
||||
printf "${BL}**${YW} 2)${GN} Dark Theme ${CL}\n"
|
||||
|
@ -32,75 +32,84 @@ echo -e "${RD} Backup your Node-Red flows before installing any theme!!${CL} \n
|
|||
read opt
|
||||
}
|
||||
|
||||
option_picked(){
|
||||
msgcolor=`echo "\033[01;31m"`
|
||||
normal=`echo "\033[00;00m"`
|
||||
option_picked() {
|
||||
msgcolor=$(echo "\033[01;31m")
|
||||
normal=$(echo "\033[00;00m")
|
||||
message=${@:-"${CL}Error: No message passed"}
|
||||
printf "${RD}${message}${CL}\n"
|
||||
}
|
||||
|
||||
clear
|
||||
show_menu
|
||||
while [ "$opt" != " " ]
|
||||
do
|
||||
case $opt in
|
||||
1) clear;
|
||||
option_picked "Installing Default Theme";
|
||||
THEME=
|
||||
JS=//
|
||||
break;
|
||||
while [ "$opt" != " " ]; do
|
||||
case $opt in
|
||||
1)
|
||||
clear
|
||||
option_picked "Installing Default Theme"
|
||||
THEME=
|
||||
JS=//
|
||||
break
|
||||
;;
|
||||
2) clear;
|
||||
option_picked "Installing Dark Theme";
|
||||
THEME=dark
|
||||
break;
|
||||
2)
|
||||
clear
|
||||
option_picked "Installing Dark Theme"
|
||||
THEME=dark
|
||||
break
|
||||
;;
|
||||
3) clear;
|
||||
option_picked "Installing Dracula Theme";
|
||||
THEME=dracula
|
||||
break;
|
||||
3)
|
||||
clear
|
||||
option_picked "Installing Dracula Theme"
|
||||
THEME=dracula
|
||||
break
|
||||
;;
|
||||
4) clear;
|
||||
option_picked "Installing Midnight-Red Theme";
|
||||
THEME=midnight-red
|
||||
break;
|
||||
4)
|
||||
clear
|
||||
option_picked "Installing Midnight-Red Theme"
|
||||
THEME=midnight-red
|
||||
break
|
||||
;;
|
||||
5) clear;
|
||||
option_picked "Installing Oled Theme";
|
||||
THEME=oled
|
||||
break;
|
||||
5)
|
||||
clear
|
||||
option_picked "Installing Oled Theme"
|
||||
THEME=oled
|
||||
break
|
||||
;;
|
||||
6) clear;
|
||||
option_picked "Installing Solarized-Dark Theme";
|
||||
THEME=solarized-dark
|
||||
break;
|
||||
6)
|
||||
clear
|
||||
option_picked "Installing Solarized-Dark Theme"
|
||||
THEME=solarized-dark
|
||||
break
|
||||
;;
|
||||
7) clear;
|
||||
option_picked "Installing Solarized-Light Theme";
|
||||
THEME=solarized-light
|
||||
break;
|
||||
7)
|
||||
clear
|
||||
option_picked "Installing Solarized-Light Theme"
|
||||
THEME=solarized-light
|
||||
break
|
||||
;;
|
||||
|
||||
x)exit;
|
||||
x)
|
||||
exit
|
||||
;;
|
||||
\n)exit;
|
||||
\n)
|
||||
exit
|
||||
;;
|
||||
*)clear;
|
||||
option_picked "Please choose a theme from the menu";
|
||||
show_menu;
|
||||
*)
|
||||
clear
|
||||
option_picked "Please choose a theme from the menu"
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
done
|
||||
esac
|
||||
done
|
||||
echo -en "${GN} Installing ${THEME} Theme... "
|
||||
cd /root/.node-red
|
||||
if [ "${THEME}" = "" ]; then
|
||||
echo -e "${CM}${CL} \r"
|
||||
else
|
||||
npm install @node-red-contrib-themes/${THEME} &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -e "${CM}${CL} \r"
|
||||
else
|
||||
npm install @node-red-contrib-themes/${THEME} &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
fi
|
||||
echo -en "${GN} Writing Settings... "
|
||||
cat <<EOF > /root/.node-red/settings.js
|
||||
cat <<EOF >/root/.node-red/settings.js
|
||||
module.exports = { uiPort: process.env.PORT || 1880,
|
||||
mqttReconnectTime: 15000,
|
||||
serialReconnectTime: 15000,
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 3, length($2)-4) }') \
|
||||
RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
|
||||
function update_info {
|
||||
echo -e "${RD}
|
||||
echo -e "${RD}
|
||||
_ _ _____ __ __
|
||||
| \ | | | __ \ | \/ |
|
||||
| \| | | |__) | | \ / |
|
||||
|
@ -24,19 +24,19 @@ ${CL}"
|
|||
update_info
|
||||
|
||||
while true; do
|
||||
read -p "This will update Nginx Proxy Manager to v${RELEASE}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "This will update Nginx Proxy Manager to v${RELEASE}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
update_info
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
shopt -s expand_aliases
|
||||
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||
trap die ERR
|
||||
|
@ -57,23 +57,23 @@ function msg() {
|
|||
T="$(date +%M)"
|
||||
|
||||
if [ -f /lib/systemd/system/npm.service ]; then
|
||||
echo -en "${GN} Prep For Update... "
|
||||
sleep 2
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Stopping Services... "
|
||||
echo -en "${GN} Prep For Update... "
|
||||
sleep 2
|
||||
echo -e "${CM}${CL} \r"
|
||||
echo -en "${GN} Stopping Services... "
|
||||
systemctl stop openresty
|
||||
systemctl stop npm
|
||||
echo -e "${CM}${CL} \r"
|
||||
|
||||
echo -en "${GN} Cleaning Old Files... "
|
||||
rm -rf /app \
|
||||
/var/www/html \
|
||||
/etc/nginx \
|
||||
/var/log/nginx \
|
||||
/var/lib/nginx \
|
||||
/var/cache/nginx &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
else
|
||||
|
||||
echo -en "${GN} Cleaning Old Files... "
|
||||
rm -rf /app \
|
||||
/var/www/html \
|
||||
/etc/nginx \
|
||||
/var/log/nginx \
|
||||
/var/lib/nginx \
|
||||
/var/cache/nginx &>/dev/null
|
||||
echo -e "${CM}${CL} \r"
|
||||
else
|
||||
echo -en "${RD} No NPM to Update! ${CL}"
|
||||
exit
|
||||
fi
|
||||
|
@ -103,24 +103,24 @@ cp docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-prox
|
|||
ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
|
||||
rm -f /etc/nginx/conf.d/dev.conf
|
||||
mkdir -p /tmp/nginx/body \
|
||||
/run/nginx \
|
||||
/data/nginx \
|
||||
/data/custom_ssl \
|
||||
/data/logs \
|
||||
/data/access \
|
||||
/data/nginx/default_host \
|
||||
/data/nginx/default_www \
|
||||
/data/nginx/proxy_host \
|
||||
/data/nginx/redirection_host \
|
||||
/data/nginx/stream \
|
||||
/data/nginx/dead_host \
|
||||
/data/nginx/temp \
|
||||
/var/lib/nginx/cache/public \
|
||||
/var/lib/nginx/cache/private \
|
||||
/var/cache/nginx/proxy_temp
|
||||
/run/nginx \
|
||||
/data/nginx \
|
||||
/data/custom_ssl \
|
||||
/data/logs \
|
||||
/data/access \
|
||||
/data/nginx/default_host \
|
||||
/data/nginx/default_www \
|
||||
/data/nginx/proxy_host \
|
||||
/data/nginx/redirection_host \
|
||||
/data/nginx/stream \
|
||||
/data/nginx/dead_host \
|
||||
/data/nginx/temp \
|
||||
/var/lib/nginx/cache/public \
|
||||
/var/lib/nginx/cache/private \
|
||||
/var/cache/nginx/proxy_temp
|
||||
chmod -R 777 /var/cache/nginx
|
||||
chown root /tmp/nginx
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" >/etc/nginx/conf.d/include/resolvers.conf
|
||||
echo -e "${CM}${CL} \r"
|
||||
|
||||
if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]; then
|
||||
|
@ -144,7 +144,7 @@ echo -e "${CM}${CL} \r"
|
|||
echo -en "${GN} Initializing Backend... "
|
||||
rm -rf /app/config/default.json &>/dev/null
|
||||
if [ ! -f /app/config/production.json ]; then
|
||||
cat << 'EOF' > /app/config/production.json
|
||||
cat <<'EOF' >/app/config/production.json
|
||||
{
|
||||
"database": {
|
||||
"engine": "knex-native",
|
||||
|
@ -168,7 +168,7 @@ systemctl enable npm &>/dev/null
|
|||
systemctl start openresty
|
||||
systemctl start npm
|
||||
echo -e "${CM}${CL} \r"
|
||||
TS="$(($(date +%M)-T))"
|
||||
TS="$(($(date +%M) - T))"
|
||||
|
||||
IP=$(hostname -I | cut -f1 -d ' ')
|
||||
echo -e "${GN}Successfully Updated Nginx Proxy Manager to ${RD}${RELEASE}${CL} and it took ${RD}${TS} minutes.${CL}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
clear
|
||||
RELEASE=$(curl -s https://api.github.com/repos/paperless-ngx/paperless-ngx/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
RETRY_NUM=10
|
||||
RETRY_EVERY=3
|
||||
NUM=$RETRY_NUM
|
||||
|
@ -30,7 +30,7 @@ function msg_error() {
|
|||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
____ __
|
||||
/ __ \____ _____ ___ _____/ /__ __________ ____ ____ __ __
|
||||
/ /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/___/ __ \/ __ `/ |/_/
|
||||
|
@ -42,9 +42,9 @@ EOF
|
|||
while true; do
|
||||
read -p "This will Update Paperless-ngx to $RELEASE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sleep 2
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
RELEASE=$(curl -s https://api.github.com/repos/photoprism/photoprism/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 2, length($2)-4) }') \
|
||||
RELEASE=$(curl -s https://api.github.com/repos/photoprism/photoprism/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 2, length($2)-4) }')
|
||||
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
PP=`echo "\e[1;35m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
PP=$(echo "\e[1;35m")
|
||||
|
||||
while true; do
|
||||
read -p "Update PhotoPrism LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${PP}
|
||||
echo -e "${PP}
|
||||
_____ _ _ _____ _
|
||||
| __ \| | | | | __ \ (_)
|
||||
| |__) | |__ ___ | |_ ___ | |__) | __ _ ___ _ __ ___
|
||||
|
@ -34,7 +34,7 @@ ${CL}"
|
|||
}
|
||||
|
||||
header_info
|
||||
show_menu(){
|
||||
show_menu() {
|
||||
printf " ${YW} 1)${GN} Release Branch ${CL}\n"
|
||||
printf " ${YW} 2)${YW} Develop Branch ${CL}\n"
|
||||
|
||||
|
@ -42,37 +42,41 @@ show_menu(){
|
|||
read opt
|
||||
}
|
||||
|
||||
option_picked(){
|
||||
option_picked() {
|
||||
message1=${@:-"${CL}Error: No message passed"}
|
||||
printf " ${YW}${message1}${CL}\n"
|
||||
}
|
||||
show_menu
|
||||
while [ "$opt" != " " ]
|
||||
do
|
||||
case $opt in
|
||||
1) clear;
|
||||
header_info;
|
||||
option_picked "Using Release Branch";
|
||||
BR="release"
|
||||
break;
|
||||
while [ "$opt" != " " ]; do
|
||||
case $opt in
|
||||
1)
|
||||
clear
|
||||
header_info
|
||||
option_picked "Using Release Branch"
|
||||
BR="release"
|
||||
break
|
||||
;;
|
||||
2) clear;
|
||||
header_info;
|
||||
option_picked "Using Develop Branch";
|
||||
BR="develop"
|
||||
break;
|
||||
2)
|
||||
clear
|
||||
header_info
|
||||
option_picked "Using Develop Branch"
|
||||
BR="develop"
|
||||
break
|
||||
;;
|
||||
|
||||
x)exit;
|
||||
x)
|
||||
exit
|
||||
;;
|
||||
\n)exit;
|
||||
\n)
|
||||
exit
|
||||
;;
|
||||
*)clear;
|
||||
option_picked "Please choose a Install Branch from the menu";
|
||||
show_menu;
|
||||
*)
|
||||
clear
|
||||
option_picked "Please choose a Install Branch from the menu"
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
done
|
||||
esac
|
||||
done
|
||||
|
||||
echo -en "${GN} Stopping PhotoPrism... "
|
||||
sudo systemctl stop photoprism
|
||||
|
@ -100,5 +104,3 @@ sudo systemctl start photoprism
|
|||
echo -e "${CM}${CL} \n"
|
||||
|
||||
echo -e "${GN} Finished ${CL} \n "
|
||||
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/pms-copy-data.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Plex Media Server LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from one Plex Media Server LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -58,28 +58,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Plex Media Server LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Plex Media Server LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Plex Media Server LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Plex Media Server LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.01.24" 13 50 || exit
|
||||
info "Plex Media Server Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -89,13 +89,13 @@ if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then
|
|||
fi
|
||||
msg "Mounting Container Disks..."
|
||||
DATA_PATH=/var/lib/plexmediaserver/Library/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] ||
|
||||
die "Plex Media Server directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH}" ] ||
|
||||
die "Plex Media Server directories in '$CTID_TO' not found."
|
||||
|
||||
#rm -rf ${CTID_TO_PATH}${DATA_PATH}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/podman-copy-data-docker.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Podman Home Assistant LXC to a Docker Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Podman Home Assistant LXC to a Docker Home Assistant LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -58,28 +58,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA Podman LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA Podman LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich HA LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich HA LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.03.31" 13 50 || exit
|
||||
info "Home Assistant Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -90,13 +90,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DOCKER_PATH=/var/lib/docker/volumes/hass_config/
|
||||
PODMAN_PATH=/var/lib/containers/storage/volumes/hass_config/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${PODMAN_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${PODMAN_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DOCKER_PATH}" ] ||
|
||||
die "Home Assistant directories in '$CTID_TO' not found."
|
||||
|
||||
rm -rf ${CTID_TO_PATH}${DOCKER_PATH}
|
||||
|
|
|
@ -4,9 +4,9 @@ echo -e "\e[1;33m This script will install Home Assistant Community Store (HACS)
|
|||
while true; do
|
||||
read -p "Start the HACS Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -17,19 +17,19 @@ echo -e "${BL}This script will Perform Post Install Routines.${CL}"
|
|||
while true; do
|
||||
read -p "Start the PBS Post Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "\n🛑 PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
echo -e "\n🛑 PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function header_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
____ ____ _____ ____ __ ____ __ ____
|
||||
/ __ \/ __ ) ___/ / __ \____ _____/ /_ / _/___ _____/ /_____ _/ / /
|
||||
/ /_/ / __ \__ \ / /_/ / __ \/ ___/ __/ / // __ \/ ___/ __/ __ `/ / /
|
||||
|
@ -52,74 +52,67 @@ function msg_ok() {
|
|||
clear
|
||||
header_info
|
||||
read -r -p "Disable Enterprise Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Disabling Enterprise Repository"
|
||||
sleep 2
|
||||
sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pbs-enterprise.list
|
||||
msg_ok "Disabled Enterprise Repository"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Disabling Enterprise Repository"
|
||||
sleep 2
|
||||
sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pbs-enterprise.list
|
||||
msg_ok "Disabled Enterprise Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Add/Correct PBS Sources (sources.list)? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Adding or Correcting PBS Sources"
|
||||
cat <<EOF > /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Adding or Correcting PBS Sources"
|
||||
cat <<EOF >/etc/apt/sources.list
|
||||
deb http://ftp.debian.org/debian bullseye main contrib
|
||||
deb http://ftp.debian.org/debian bullseye-updates main contrib
|
||||
deb http://security.debian.org/debian-security bullseye-security main contrib
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Added or Corrected PBS Sources"
|
||||
sleep 2
|
||||
msg_ok "Added or Corrected PBS Sources"
|
||||
fi
|
||||
|
||||
read -r -p "Enable No-Subscription Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Enabling No-Subscription Repository"
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Enabling No-Subscription Repository"
|
||||
cat <<EOF >>/etc/apt/sources.list
|
||||
deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Enabled No-Subscription Repository"
|
||||
sleep 2
|
||||
msg_ok "Enabled No-Subscription Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Add (Disabled) Beta/Test Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Adding Beta/Test Repository and set disabled"
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Adding Beta/Test Repository and set disabled"
|
||||
cat <<EOF >>/etc/apt/sources.list
|
||||
# deb http://download.proxmox.com/debian/pbs bullseye pbstest
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Added Beta/Test Repository"
|
||||
sleep 2
|
||||
msg_ok "Added Beta/Test Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Disable Subscription Nag? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Disabling Subscription Nag"
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
|
||||
apt --reinstall install proxmox-widget-toolkit &>/dev/null
|
||||
msg_ok "Disabled Subscription Nag"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Disabling Subscription Nag"
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
|
||||
apt --reinstall install proxmox-widget-toolkit &>/dev/null
|
||||
msg_ok "Disabled Subscription Nag"
|
||||
fi
|
||||
|
||||
read -r -p "Update Proxmox Backup Server now? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Updating Proxmox Backup Server (Patience)"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y dist-upgrade &>/dev/null
|
||||
msg_ok "Updated Proxmox Backup Server (⚠ Reboot Recommended)"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Updating Proxmox Backup Server (Patience)"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y dist-upgrade &>/dev/null
|
||||
msg_ok "Updated Proxmox Backup Server (⚠ Reboot Recommended)"
|
||||
fi
|
||||
|
||||
read -r -p "Reboot Proxmox Backup Server now? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Rebooting Proxmox Backup Server"
|
||||
sleep 2
|
||||
msg_ok "Completed Post Install Routines"
|
||||
reboot
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Rebooting Proxmox Backup Server"
|
||||
sleep 2
|
||||
msg_ok "Completed Post Install Routines"
|
||||
reboot
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#!/usr/bin/env bash -ex
|
||||
set -euo pipefail
|
||||
shopt -s inherit_errexit nullglob
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -17,26 +17,26 @@ echo -e "${BL}This script will Perform Post Install Routines.${CL}"
|
|||
while true; do
|
||||
read -p "Start the PVE7 Post Install Script (y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
echo -e "\n🛑 No PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
echo -e "\n🛑 No PVE Detected, Wrong Script!\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ `pveversion | grep "pve-manager/7" | wc -l` -ne 1 ]; then
|
||||
echo -e "\n${RD}⚠ This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires PVE Version: 7.XX${CL}"
|
||||
echo -e "\nExiting..."
|
||||
sleep 3
|
||||
exit
|
||||
if [ $(pveversion | grep "pve-manager/7" | wc -l) -ne 1 ]; then
|
||||
echo -e "\n${RD}⚠ This version of Proxmox Virtual Environment is not supported"
|
||||
echo -e "Requires PVE Version: 7.XX${CL}"
|
||||
echo -e "\nExiting..."
|
||||
sleep 3
|
||||
exit
|
||||
fi
|
||||
function header_info {
|
||||
echo -e "${RD}
|
||||
echo -e "${RD}
|
||||
____ _ _____________ ____ __ ____ __ ____
|
||||
/ __ \ | / / ____/__ / / __ \____ _____/ /_ / _/___ _____/ /_____ _/ / /
|
||||
/ /_/ / | / / __/ / / / /_/ / __ \/ ___/ __/ / // __ \/ ___/ __/ __ / / /
|
||||
|
@ -58,74 +58,67 @@ function msg_ok() {
|
|||
clear
|
||||
header_info
|
||||
read -r -p "Disable Enterprise Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Disabling Enterprise Repository"
|
||||
sleep 2
|
||||
sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list
|
||||
msg_ok "Disabled Enterprise Repository"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Disabling Enterprise Repository"
|
||||
sleep 2
|
||||
sed -i "s/^deb/#deb/g" /etc/apt/sources.list.d/pve-enterprise.list
|
||||
msg_ok "Disabled Enterprise Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Add/Correct PVE7 Sources (sources.list)? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Adding or Correcting PVE7 Sources"
|
||||
cat <<EOF > /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Adding or Correcting PVE7 Sources"
|
||||
cat <<EOF >/etc/apt/sources.list
|
||||
deb http://ftp.debian.org/debian bullseye main contrib
|
||||
deb http://ftp.debian.org/debian bullseye-updates main contrib
|
||||
deb http://security.debian.org/debian-security bullseye-security main contrib
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Added or Corrected PVE7 Sources"
|
||||
sleep 2
|
||||
msg_ok "Added or Corrected PVE7 Sources"
|
||||
fi
|
||||
|
||||
read -r -p "Enable No-Subscription Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Enabling No-Subscription Repository"
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Enabling No-Subscription Repository"
|
||||
cat <<EOF >>/etc/apt/sources.list
|
||||
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Enabled No-Subscription Repository"
|
||||
sleep 2
|
||||
msg_ok "Enabled No-Subscription Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Add (Disabled) Beta/Test Repository? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Adding Beta/Test Repository and set disabled"
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Adding Beta/Test Repository and set disabled"
|
||||
cat <<EOF >>/etc/apt/sources.list
|
||||
# deb http://download.proxmox.com/debian/pve bullseye pvetest
|
||||
EOF
|
||||
sleep 2
|
||||
msg_ok "Added Beta/Test Repository"
|
||||
sleep 2
|
||||
msg_ok "Added Beta/Test Repository"
|
||||
fi
|
||||
|
||||
read -r -p "Disable Subscription Nag? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Disabling Subscription Nag"
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
|
||||
apt --reinstall install proxmox-widget-toolkit &>/dev/null
|
||||
msg_ok "Disabled Subscription Nag (Delete browser cache)"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Disabling Subscription Nag"
|
||||
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" >/etc/apt/apt.conf.d/no-nag-script
|
||||
apt --reinstall install proxmox-widget-toolkit &>/dev/null
|
||||
msg_ok "Disabled Subscription Nag (Delete browser cache)"
|
||||
fi
|
||||
|
||||
read -r -p "Update Proxmox VE 7 now? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Updating Proxmox VE 7 (Patience)"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y dist-upgrade &>/dev/null
|
||||
msg_ok "Updated Proxmox VE 7 (⚠ Reboot Recommended)"
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Updating Proxmox VE 7 (Patience)"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y dist-upgrade &>/dev/null
|
||||
msg_ok "Updated Proxmox VE 7 (⚠ Reboot Recommended)"
|
||||
fi
|
||||
|
||||
read -r -p "Reboot Proxmox VE 7 now? <y/N> " prompt
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
|
||||
then
|
||||
msg_info "Rebooting Proxmox VE 7"
|
||||
sleep 2
|
||||
msg_ok "Completed Post Install Routines"
|
||||
reboot
|
||||
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
|
||||
msg_info "Rebooting Proxmox VE 7"
|
||||
sleep 2
|
||||
msg_ok "Completed Post Install Routines"
|
||||
reboot
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
|
|
|
@ -4,14 +4,14 @@ set -e
|
|||
while true; do
|
||||
read -p "View CPU Scaling Governors. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "
|
||||
echo -e "
|
||||
_____ _____ _ _
|
||||
/ ____| __ \| | | |
|
||||
| | | |__) | | | |
|
||||
|
@ -21,16 +21,16 @@ echo -e "
|
|||
Scaling Governors
|
||||
"
|
||||
}
|
||||
show_menu(){
|
||||
CL=`echo "\033[m"`
|
||||
GN=`echo "\033[32m"`
|
||||
BL=`echo "\033[36m"`
|
||||
YW=`echo "\033[33m"`
|
||||
fgred=`echo "\033[31m"`
|
||||
header_info
|
||||
show_menu() {
|
||||
CL=$(echo "\033[m")
|
||||
GN=$(echo "\033[32m")
|
||||
BL=$(echo "\033[36m")
|
||||
YW=$(echo "\033[33m")
|
||||
fgred=$(echo "\033[31m")
|
||||
header_info
|
||||
CK=$(uname -r)
|
||||
IP=$(hostname -I)
|
||||
# MAC=$(cat /sys/class/net/eno1/address)
|
||||
# MAC=$(cat /sys/class/net/eno1/address)
|
||||
ACSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)
|
||||
CCSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
||||
echo -e "${YW}Proxmox IP ${BL}${IP}${CL}"
|
||||
|
@ -41,7 +41,7 @@ header_info
|
|||
|
||||
echo -e "\n${YW}Available CPU Scaling Governors
|
||||
${BL}${ACSG}${CL}"
|
||||
|
||||
|
||||
echo -e "\n${YW}Current CPU Scaling Governor
|
||||
${BL}${CCSG}${CL}"
|
||||
printf "\n ${fgred}Only Select Available CPU Scaling Governors From Above${CL}\n \n"
|
||||
|
@ -57,43 +57,51 @@ header_info
|
|||
}
|
||||
clear
|
||||
show_menu
|
||||
while [ $opt != '' ]
|
||||
do
|
||||
while [ $opt != '' ]; do
|
||||
if [ $opt = '' ]; then
|
||||
exit;
|
||||
exit
|
||||
else
|
||||
case $opt in
|
||||
1) echo "conservative" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
case $opt in
|
||||
1)
|
||||
echo "conservative" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
2) echo "ondemand" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
;;
|
||||
2)
|
||||
echo "ondemand" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
3) echo "userspace" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
;;
|
||||
3)
|
||||
echo "userspace" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
4) echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
;;
|
||||
4)
|
||||
echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
5) echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
;;
|
||||
5)
|
||||
echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
6) echo "schedutil" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
;;
|
||||
6)
|
||||
echo "schedutil" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
x)exit;
|
||||
;;
|
||||
\n)exit;
|
||||
;;
|
||||
*)clear;
|
||||
show_menu;
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
x)
|
||||
exit
|
||||
;;
|
||||
\n)
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
show_menu
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
|
|
@ -7,61 +7,52 @@ dnsUrl="https://download.technitium.com/dns/DnsServerPortable.tar.gz"
|
|||
|
||||
mkdir -p $dnsDir
|
||||
installLog="$dnsDir/install.log"
|
||||
echo "" > $installLog
|
||||
echo "" >$installLog
|
||||
|
||||
echo ""
|
||||
echo "==============================="
|
||||
echo "Technitium DNS Server Update"
|
||||
echo "==============================="
|
||||
|
||||
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 6.0.";
|
||||
then
|
||||
if dotnet --list-runtimes 2>/dev/null | grep -q "Microsoft.NETCore.App 6.0."; then
|
||||
dotnetFound="yes"
|
||||
else
|
||||
dotnetFound="no"
|
||||
fi
|
||||
|
||||
if [ -d $dotnetDir ]
|
||||
then
|
||||
dotnetUpdate="yes"
|
||||
echo "Updating .NET 6 Runtime..."
|
||||
if [ -d $dotnetDir ]; then
|
||||
dotnetUpdate="yes"
|
||||
echo "Updating .NET 6 Runtime..."
|
||||
fi
|
||||
|
||||
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 6.0 --runtime dotnet --no-path --install-dir $dotnetDir --verbose >>$installLog 2>&1
|
||||
|
||||
if [ ! -f "/usr/bin/dotnet" ]; then
|
||||
ln -s $dotnetDir/dotnet /usr/bin >>$installLog 2>&1
|
||||
fi
|
||||
|
||||
if dotnet --list-runtimes 2>/dev/null | grep -q "Microsoft.NETCore.App 6.0."; then
|
||||
if [ "$dotnetUpdate" = "yes" ]; then
|
||||
echo ".NET 6 Runtime was updated successfully!"
|
||||
fi
|
||||
else
|
||||
echo "Failed to update .NET 6 Runtime. Please try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c 6.0 --runtime dotnet --no-path --install-dir $dotnetDir --verbose >> $installLog 2>&1
|
||||
|
||||
if [ ! -f "/usr/bin/dotnet" ]
|
||||
then
|
||||
ln -s $dotnetDir/dotnet /usr/bin >> $installLog 2>&1
|
||||
fi
|
||||
|
||||
if dotnet --list-runtimes 2> /dev/null | grep -q "Microsoft.NETCore.App 6.0.";
|
||||
then
|
||||
if [ "$dotnetUpdate" = "yes" ]
|
||||
then
|
||||
echo ".NET 6 Runtime was updated successfully!"
|
||||
fi
|
||||
else
|
||||
echo "Failed to update .NET 6 Runtime. Please try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if curl -o $dnsTar --fail $dnsUrl >> $installLog 2>&1
|
||||
then
|
||||
if [ -d $dnsDir ]
|
||||
then
|
||||
if curl -o $dnsTar --fail $dnsUrl >>$installLog 2>&1; then
|
||||
if [ -d $dnsDir ]; then
|
||||
echo "Updating Technitium DNS Server..."
|
||||
fi
|
||||
|
||||
tar -zxf $dnsTar -C $dnsDir >> $installLog 2>&1
|
||||
|
||||
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]
|
||||
then
|
||||
if [ -f "/etc/systemd/system/dns.service" ]
|
||||
then
|
||||
|
||||
tar -zxf $dnsTar -C $dnsDir >>$installLog 2>&1
|
||||
|
||||
if [ "$(ps --no-headers -o comm 1 | tr -d '\n')" = "systemd" ]; then
|
||||
if [ -f "/etc/systemd/system/dns.service" ]; then
|
||||
echo "Restarting systemd service..."
|
||||
systemctl restart dns.service >> $installLog 2>&1
|
||||
systemctl restart dns.service >>$installLog 2>&1
|
||||
fi
|
||||
|
||||
|
||||
echo ""
|
||||
echo "Technitium DNS Server was updated successfully!"
|
||||
else
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 3, length($2)-4) }')
|
||||
RELEASE=$(curl -s https://api.github.com/repos/zadam/trilium/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
function update_info {
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
______ _ ___
|
||||
/_ __/____(_) (_)_ ______ ___
|
||||
/ / / ___/ / / / / / / __ `__ \
|
||||
|
@ -23,9 +23,9 @@ update_info
|
|||
while true; do
|
||||
read -p "This will Update Trilium to v$RELEASE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sleep 2
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
APP="UniFi Update"
|
||||
while true; do
|
||||
read -p "This will run ${APP}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${RD}
|
||||
echo -e "${RD}
|
||||
_ _ _ ______ _
|
||||
| | | | (_) ____(_)
|
||||
| | | |_ __ _| |__ _
|
||||
|
@ -30,4 +30,3 @@ ${CL}"
|
|||
header_info
|
||||
sleep 3
|
||||
wget -qL https://get.glennr.nl/unifi/update/unifi-update.sh && bash unifi-update.sh
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
while true; do
|
||||
read -p "This Will Update All LXC Containers. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "This Will Update All LXC Containers. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${BL}
|
||||
echo -e "${BL}
|
||||
_ _ _____ _____ _______ ______
|
||||
| | | | __ \| __ \ /\|__ __| ____|
|
||||
| | | | |__) | | | | / \ | | | |__
|
||||
|
@ -39,34 +39,33 @@ function update_container() {
|
|||
}
|
||||
read -p "Skip stopped containers? " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
skip=no
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
skip=no
|
||||
else
|
||||
skip=yes
|
||||
skip=yes
|
||||
fi
|
||||
|
||||
for container in $containers
|
||||
do
|
||||
status=`pct status $container`
|
||||
if [ "$skip" == "no" ]; then
|
||||
if [ "$status" == "status: stopped" ]; then
|
||||
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
|
||||
pct start $container
|
||||
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
|
||||
sleep 5
|
||||
update_container $container
|
||||
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
||||
pct shutdown $container &
|
||||
elif [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
for container in $containers; do
|
||||
status=$(pct status $container)
|
||||
if [ "$skip" == "no" ]; then
|
||||
if [ "$status" == "status: stopped" ]; then
|
||||
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
|
||||
pct start $container
|
||||
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
|
||||
sleep 5
|
||||
update_container $container
|
||||
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
||||
pct shutdown $container &
|
||||
elif [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "$skip" == "yes" ]; then
|
||||
if [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
if [ "$skip" == "yes" ]; then
|
||||
if [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done; wait
|
||||
done
|
||||
wait
|
||||
|
||||
echo -e "${GN} Finished, All Containers Updated. ${CL} \n"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash -ex
|
||||
LATEST=$(curl -sL https://api.github.com/repos/louislam/uptime-kuma/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||
YW=`echo "\033[33m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BGN=`echo "\033[4;92m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
DGN=`echo "\033[32m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
BL=$(echo "\033[36m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BGN=$(echo "\033[4;92m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
DGN=$(echo "\033[32m")
|
||||
CL=$(echo "\033[m")
|
||||
BFR="\\r\\033[K"
|
||||
HOLD="-"
|
||||
CM="${GN}✓${CL}"
|
||||
|
@ -14,14 +14,14 @@ APP="Uptime Kuma"
|
|||
while true; do
|
||||
read -p "This will Update ${APP} to ${LATEST}. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
function header_info {
|
||||
echo -e "${DGN}
|
||||
echo -e "${DGN}
|
||||
_ _ _ _ _ __
|
||||
| | | | | | (_) | |/ /
|
||||
| | | |_v3_ | |_ _ _ __ ___ ___ | ' /_ _ _ __ ___ __ _
|
||||
|
@ -45,7 +45,10 @@ function msg_ok() {
|
|||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
if [ ! -d "/opt/uptime-kuma" ]; then echo -e "No Uptime Kuma Directory Found."; exit; fi
|
||||
if [ ! -d "/opt/uptime-kuma" ]; then
|
||||
echo -e "No Uptime Kuma Directory Found."
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Stopping ${APP}"
|
||||
sudo systemctl stop uptime-kuma &>/dev/null
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
echo -e "\e[1;33m This script will allow USB passthrough to a PRIVILEGED LXC Container ONLY\e[0m"
|
||||
while true; do
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Did you replace 106 with your LXC ID? Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
|
||||
set -o errexit
|
||||
|
@ -45,7 +45,7 @@ for char_dev in ${CHAR_DEVS[@]}; do
|
|||
CHAR_DEV_STRING+=" -regex \".*/${char_dev}\""
|
||||
done
|
||||
|
||||
read -r -d '' HOOK_SCRIPT <<- EOF || true
|
||||
read -r -d '' HOOK_SCRIPT <<-EOF || true
|
||||
for char_dev in \$(find /sys/dev/char -regextype sed $CHAR_DEV_STRING); do
|
||||
dev="/dev/\$(sed -n "/DEVNAME/ s/^.*=\(.*\)$/\1/p" \${char_dev}/uevent)";
|
||||
mkdir -p \$(dirname \${LXC_ROOTFS_MOUNT}\${dev});
|
||||
|
@ -63,7 +63,7 @@ CTID_CONFIG_PATH=/etc/pve/lxc/${CTID}.conf
|
|||
sed '/autodev/d' $CTID_CONFIG_PATH >CTID.conf
|
||||
cat CTID.conf >$CTID_CONFIG_PATH
|
||||
|
||||
cat <<EOF >> $CTID_CONFIG_PATH
|
||||
cat <<EOF >>$CTID_CONFIG_PATH
|
||||
lxc.autodev: 1
|
||||
lxc.hook.autodev: bash -c '$HOOK_SCRIPT'
|
||||
EOF
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
VAULT=$(curl -s https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 2, length($2)-3) }')
|
||||
VAULT=$(curl -s https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 2, length($2)-3) }')
|
||||
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
function update_info {
|
||||
echo -e "${BL}
|
||||
echo -e "${BL}
|
||||
__ __ _ _ _
|
||||
\ \ / / | | | | |
|
||||
\ \ / /_ _ _ _| | |___ ____ _ _ __ __| | ___ _ __
|
||||
|
@ -24,9 +24,9 @@ update_info
|
|||
while true; do
|
||||
read -p "This will Update Vaultwarden to $VAULT (set 2vCPU 2048MiB RAM Min.). Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sleep 2
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
VWRELEASE=$(curl -s https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest \
|
||||
| grep "tag_name" \
|
||||
| awk '{print substr($2, 2, length($2)-3) }')
|
||||
VWRELEASE=$(curl -s https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest |
|
||||
grep "tag_name" |
|
||||
awk '{print substr($2, 2, length($2)-3) }')
|
||||
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
function update_info {
|
||||
echo -e "${BL}
|
||||
echo -e "${BL}
|
||||
__ __ _ _ _
|
||||
\ \ / / | | | | |
|
||||
\ \ /\ / /__| |__ ________ ____ _ _ _| | |_
|
||||
|
@ -23,9 +23,9 @@ update_info
|
|||
while true; do
|
||||
read -p "This will Update Web-Vault to $VWRELEASE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
sleep 2
|
||||
|
@ -36,9 +36,9 @@ sleep 1
|
|||
echo -e "${GN} Updating to ${VWRELEASE}... ${CL}"
|
||||
curl -fsSLO https://github.com/dani-garcia/bw_web_builds/releases/download/$VWRELEASE/bw_web_$VWRELEASE.tar.gz &>/dev/null
|
||||
if [ -d "/var/lib/vaultwarden" ]; then
|
||||
tar -xzf bw_web_$VWRELEASE.tar.gz -C /var/lib/vaultwarden/ &>/dev/null
|
||||
else
|
||||
tar -zxf bw_web_$VWRELEASE.tar.gz -C /opt/vaultwarden/ &>/dev/null
|
||||
tar -xzf bw_web_$VWRELEASE.tar.gz -C /var/lib/vaultwarden/ &>/dev/null
|
||||
else
|
||||
tar -zxf bw_web_$VWRELEASE.tar.gz -C /opt/vaultwarden/ &>/dev/null
|
||||
fi
|
||||
|
||||
echo -e "${GN} Cleaning up... ${CL}"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
YW=$(echo "\033[33m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
CM='\xE2\x9C\x94\033'
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
while true; do
|
||||
read -p "This will Install Webmin, Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
|
@ -34,7 +34,6 @@ echo -en "${GN} Setting Default Webmin usermame & password to root... "
|
|||
rm -rf /root/webmin_2.000_all.deb
|
||||
echo -e "${CM}${CL} \r"
|
||||
IP=$(hostname -I | cut -f1 -d ' ')
|
||||
echo -e "Successfully Installed!! Webmin should be reachable by going to https://${IP}:10000"
|
||||
|
||||
echo -e "Successfully Installed!! Webmin should be reachable by going to https://${IP}:10000"
|
||||
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/webmin.sh)"
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/z2m-copy-data.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from one Zigbee2MQTT LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from one Zigbee2MQTT LXC to another. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
|
@ -58,28 +58,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Zigbee2MQTT LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Zigbee2MQTT LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Zigbee2MQTT LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Zigbee2MQTT LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.01.23" 13 50 || exit
|
||||
info "Zigbee2MQTT Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -89,13 +89,13 @@ if [ $(pct status $CTID_TO | sed 's/.* //') == 'running' ]; then
|
|||
fi
|
||||
msg "Mounting Container Disks..."
|
||||
DATA_PATH=/opt/zigbee2mqtt/data/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] ||
|
||||
die "Zigbee2igbee2MQTT directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH}" ] ||
|
||||
die "Zigbee2MQTT directories in '$CTID_TO' not found."
|
||||
|
||||
#rm -rf ${CTID_TO_PATH}${DATA_PATH}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# run from the Proxmox Shell
|
||||
# bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/zwave-copy-data.sh)"
|
||||
while true; do
|
||||
read -p "Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
read -p "Use to copy all data from a Zwavejs2MQTT LXC to a Z-wave JS UI LXC. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
set -o errexit
|
||||
|
@ -59,28 +59,28 @@ while read -r line; do
|
|||
if [[ $((${#ITEM} + $OFFSET)) -gt ${MSG_MAX_LENGTH:-} ]]; then
|
||||
MSG_MAX_LENGTH=$((${#ITEM} + $OFFSET))
|
||||
fi
|
||||
CTID_MENU+=( "$TAG" "$ITEM " "OFF" )
|
||||
CTID_MENU+=("$TAG" "$ITEM " "OFF")
|
||||
done < <(pct list | awk 'NR>1')
|
||||
while [ -z "${CTID_FROM:+x}" ]; do
|
||||
CTID_FROM=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Zwavejs2MQTT LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Zwavejs2MQTT LXC would you like to copy FROM?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
while [ -z "${CTID_TO:+x}" ]; do
|
||||
CTID_TO=$(whiptail --title "$TITLE" --radiolist \
|
||||
"\nWhich Z-wave JS UI LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
"\nWhich Z-wave JS UI LXC would you like to copy TO?\n" \
|
||||
16 $(($MSG_MAX_LENGTH + 23)) 6 \
|
||||
"${CTID_MENU[@]}" 3>&1 1>&2 2>&3) || exit
|
||||
done
|
||||
for i in ${!CTID_MENU[@]}; do
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] && \
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] && \
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i+1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_FROM" ] &&
|
||||
CTID_FROM_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
[ "${CTID_MENU[$i]}" == "$CTID_TO" ] &&
|
||||
CTID_TO_HOSTNAME=$(sed 's/[[:space:]]*$//' <<<${CTID_MENU[$i + 1]})
|
||||
done
|
||||
whiptail --defaultno --title "$TITLE" --yesno \
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
"Are you sure you want to copy data between the following LXCs?
|
||||
$CTID_FROM (${CTID_FROM_HOSTNAME}) -> $CTID_TO (${CTID_TO_HOSTNAME})
|
||||
Version: 2022.09.21" 13 50 || exit
|
||||
info "Zwavejs2MQTT Data from '$CTID_FROM' to '$CTID_TO'"
|
||||
|
@ -91,13 +91,13 @@ fi
|
|||
msg "Mounting Container Disks..."
|
||||
DATA_PATH=/opt/zwavejs2mqtt/store/
|
||||
DATA_PATH_NEW=/opt/zwave-js-ui/store/
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_FROM_PATH=$(pct mount $CTID_FROM | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_FROM}'."
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] || \
|
||||
[ -d "${CTID_FROM_PATH}${DATA_PATH}" ] ||
|
||||
die "Zwavejs2MQTT directories in '$CTID_FROM' not found."
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") || \
|
||||
CTID_TO_PATH=$(pct mount $CTID_TO | sed -n "s/.*'\(.*\)'/\1/p") ||
|
||||
die "There was a problem mounting the root disk of LXC '${CTID_TO}'."
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH_NEW}" ] || \
|
||||
[ -d "${CTID_TO_PATH}${DATA_PATH_NEW}" ] ||
|
||||
die "Zwavejs2MQTT directories in '$CTID_TO' not found."
|
||||
|
||||
#rm -rf ${CTID_TO_PATH}${DATA_PATH}
|
||||
|
@ -117,4 +117,3 @@ rsync ${RSYNC_OPTIONS[*]} ${CTID_FROM_PATH}${DATA_PATH} ${CTID_TO_PATH}${DATA_PA
|
|||
echo -en "\e[1A\e[0K\e[1A\e[0K"
|
||||
|
||||
info "Successfully Transferred Data."
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
RELEASE=$(curl -s https://api.github.com/repos/zwave-js/zwave-js-ui/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
set -e
|
||||
YW=`echo "\033[33m"`
|
||||
RD=`echo "\033[01;31m"`
|
||||
BL=`echo "\033[36m"`
|
||||
GN=`echo "\033[1;92m"`
|
||||
CL=`echo "\033[m"`
|
||||
YW=$(echo "\033[33m")
|
||||
RD=$(echo "\033[01;31m")
|
||||
BL=$(echo "\033[36m")
|
||||
GN=$(echo "\033[1;92m")
|
||||
CL=$(echo "\033[m")
|
||||
CM="${GN}✓${CL}"
|
||||
CROSS="${RD}✗${CL}"
|
||||
BFR="\\r\\033[K"
|
||||
|
@ -25,7 +25,7 @@ function msg_error() {
|
|||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||
}
|
||||
clear
|
||||
cat << "EOF"
|
||||
cat <<"EOF"
|
||||
_____ _______ __ ______
|
||||
/__ /_ ______ __ _____ / / ___/ / / / / _/
|
||||
/ /| | /| / / __ `/ | / / _ \ __ / /\__ \ / / / // /
|
||||
|
@ -38,12 +38,15 @@ EOF
|
|||
while true; do
|
||||
read -p "This will update ZWave JS UI to $RELEASE. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
[Yy]*) break ;;
|
||||
[Nn]*) exit ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
if [ ! -d /opt/zwave-js-ui ]; then msg_error "No Zwave JS UI Install Detected!"; exit; fi
|
||||
if [ ! -d /opt/zwave-js-ui ]; then
|
||||
msg_error "No Zwave JS UI Install Detected!"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Stopping Z-wave JS UI"
|
||||
systemctl stop zwave-js-ui.service
|
||||
|
@ -56,7 +59,7 @@ unzip zwave-js-ui-${RELEASE}-linux.zip &>/dev/null
|
|||
msg_ok "Updated Z-wave JS UI"
|
||||
|
||||
msg_info "Updating Z-wave JS UI service file"
|
||||
cat << EOF > /etc/systemd/system/zwave-js-ui.service
|
||||
cat <<EOF >/etc/systemd/system/zwave-js-ui.service
|
||||
[Unit]
|
||||
Description=zwave-js-ui
|
||||
Wants=network-online.target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue