mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "d46076cab98ea07325e767d1668efd5a8be01266" and "98aaaf5bd1bb50f8da0b6aa02ace05e810d97400" have entirely different histories.
d46076cab9
...
98aaaf5bd1
|
@ -66,7 +66,6 @@ function update_script() {
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
header_info
|
header_info
|
||||||
if [ "$UPD" == "1" ]; then
|
if [ "$UPD" == "1" ]; then
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
|
||||||
msg_info "Stopping all Paperless-ngx Services"
|
msg_info "Stopping all Paperless-ngx Services"
|
||||||
systemctl stop paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue.service
|
systemctl stop paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue.service
|
||||||
msg_ok "Stopped all Paperless-ngx Services"
|
msg_ok "Stopped all Paperless-ngx Services"
|
||||||
|
@ -81,7 +80,6 @@ function update_script() {
|
||||||
pip install -r requirements.txt &>/dev/null
|
pip install -r requirements.txt &>/dev/null
|
||||||
cd /opt/paperless/src
|
cd /opt/paperless/src
|
||||||
/usr/bin/python3 manage.py migrate &>/dev/null
|
/usr/bin/python3 manage.py migrate &>/dev/null
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
||||||
msg_ok "Updated to ${RELEASE}"
|
msg_ok "Updated to ${RELEASE}"
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
|
@ -95,9 +93,6 @@ function update_script() {
|
||||||
sleep 1
|
sleep 1
|
||||||
msg_ok "Started all Paperless-ngx Services"
|
msg_ok "Started all Paperless-ngx Services"
|
||||||
msg_ok "Updated Successfully!\n"
|
msg_ok "Updated Successfully!\n"
|
||||||
else
|
|
||||||
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
|
||||||
fi
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
if [ "$UPD" == "2" ]; then
|
if [ "$UPD" == "2" ]; then
|
||||||
|
|
|
@ -90,7 +90,6 @@ sed -i -e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/op
|
||||||
sed -i -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/opt/paperless/data|" /opt/paperless/paperless.conf
|
sed -i -e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/opt/paperless/data|" /opt/paperless/paperless.conf
|
||||||
sed -i -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/opt/paperless/media|" /opt/paperless/paperless.conf
|
sed -i -e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/opt/paperless/media|" /opt/paperless/paperless.conf
|
||||||
sed -i -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/opt/paperless/static|" /opt/paperless/paperless.conf
|
sed -i -e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/opt/paperless/static|" /opt/paperless/paperless.conf
|
||||||
echo "${Paperlessngx}" >/opt/${APPLICATION}_version.txt
|
|
||||||
msg_ok "Installed Paperless-ngx"
|
msg_ok "Installed Paperless-ngx"
|
||||||
|
|
||||||
msg_info "Installing Natural Language Toolkit (Patience)"
|
msg_info "Installing Natural Language Toolkit (Patience)"
|
||||||
|
@ -103,7 +102,7 @@ DB_USER=paperless
|
||||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||||
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
|
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
|
||||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER TEMPLATE template0;"
|
||||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
||||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
|
||||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
|
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
|
||||||
|
|
|
@ -0,0 +1,168 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright (c) 2021-2024 tteck
|
||||||
|
# Author: tteck (tteckster)
|
||||||
|
# License: MIT
|
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
|
|
||||||
|
# bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/edge-kernel.sh)"
|
||||||
|
function header_info {
|
||||||
|
cat <<"EOF"
|
||||||
|
____ _ ________ ______ __ __ __ __
|
||||||
|
/ __ \ | / / ____/ / ____/___/ /___ ____ / //_/__ _________ ___ / /____
|
||||||
|
/ /_/ / | / / __/ / __/ / __ / __ `/ _ \ / ,< / _ \/ ___/ __ \/ _ \/ / ___/
|
||||||
|
/ ____/| |/ / /___ / /___/ /_/ / /_/ / __/ / /| / __/ / / / / / __/ (__ )
|
||||||
|
/_/ |___/_____/ /_____/\__,_/\__, /\___/ /_/ |_\___/_/ /_/ /_/\___/_/____/
|
||||||
|
/____/
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
VER=$(curl -s https://api.github.com/repos/fabianishere/pve-edge-kernel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-9) }')
|
||||||
|
KER=$(curl -s https://api.github.com/repos/fabianishere/pve-edge-kernel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-6) }')
|
||||||
|
clear
|
||||||
|
header_info
|
||||||
|
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." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
clear
|
||||||
|
header_info
|
||||||
|
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"
|
||||||
|
printf "${menu}**${number} 1)${normal} Install Proxmox Edge Kernel ${menu}${KER}${normal} & Reboot\n"
|
||||||
|
printf "${menu}**${number} 2)${normal} Switch to Proxmox VE 7 ${menu}${PVE_KERNEL}${normal} Kernel & Reboot\n"
|
||||||
|
printf "${menu}**${number} 3)${normal} Switch to Proxmox Edge ${menu}${EDGE_KERNEL}${normal} Kernel & Reboot\n"
|
||||||
|
printf "${menu}**${number} 4)${normal} Unpin Current Kernel\n"
|
||||||
|
printf "${menu}**${number} 5)${normal} Remove All Current ${menu}${VER}*${normal} Proxmox Edge Kernels & Reboot\n"
|
||||||
|
printf "${menu}*********************************************${normal}\n"
|
||||||
|
printf "Please choose an option from the menu, or ${fgred}x${normal} to exit."
|
||||||
|
read opt
|
||||||
|
}
|
||||||
|
option_picked() {
|
||||||
|
msgcolor=$(echo "\033[01;31m")
|
||||||
|
normal=$(echo "\033[00;00m")
|
||||||
|
message=${@:-"${normal}Error: No message passed"}
|
||||||
|
printf "${msgcolor}${message}${normal}\n"
|
||||||
|
}
|
||||||
|
clear
|
||||||
|
header_info
|
||||||
|
show_menu
|
||||||
|
while [ "$opt" != "" ]; do
|
||||||
|
if [ "$opt" = "" ]; then
|
||||||
|
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"
|
||||||
|
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
|
||||||
|
apt-get -y update
|
||||||
|
apt-get -y install pve-kernel-${VER}-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"
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
apt --purge remove -y pve-kernel-${VER}*edge pve-headers-${VER}*edge
|
||||||
|
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"
|
||||||
|
header_info
|
||||||
|
show_menu
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
header_info
|
||||||
|
show_menu
|
|
@ -22,7 +22,7 @@ function update_container() {
|
||||||
alpine) pct exec "$container" -- ash -c "apk update && apk upgrade" ;;
|
alpine) pct exec "$container" -- ash -c "apk update && apk upgrade" ;;
|
||||||
archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;;
|
archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;;
|
||||||
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;;
|
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;;
|
||||||
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt-get upgrade --dry-run && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y" ;;
|
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt list --upgradable && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue