Skip to content

Commit

Permalink
Merge pull request #89 from BassT23/beta
Browse files Browse the repository at this point in the history
Proxmox-Updater  v3.9
  • Loading branch information
BassT23 authored Nov 7, 2023
2 parents a2cb3d6 + 8042723 commit d365853
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 89 deletions.
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
```
____
/ __ \_________ _ ______ ___ ____ _ __
/ /_/ / ___/ __ \| |/_/ __ `__ \/ __ \| |/_/
/ ____/ / / /_/ /> </ / / / / / /_/ /> <
/_/ /_/ \____/_/|_/_/ /_/ /_/\____/_/|_|
__ __ __ __
/ / / /___ ____/ /___ _/ /____ ____
/ / / / __ \/ __ / __ `/ __/ _ \/ __/
/ /_/ / /_/ / /_/ / /_/ / /_/ __/ /
\____/ .___/\____/\____/\__/\___/_/
/_/
```
<div align="center">

![Logo](https://github.com/BassT23/Proxmox/assets/30832786/00fa746d-3d65-4b01-8906-50ecb845a50d)

![Screenshot_20230326_130709](https://user-images.githubusercontent.com/30832786/227771669-aae7e7f4-b27e-4095-950a-c6fa1f146503.png)

[![GitHub release](https://img.shields.io/github/release/BassT23/Proxmox.svg)](https://GitHub.com/BassT23/Proxmox/releases/)
[![GitHub stars](https://img.shields.io/github/stars/BassT23/Proxmox.svg)](https://github.com/BassT23/Proxmox/stargazers)
[![downloads](https://img.shields.io/github/downloads/BassT23/Proxmox/total.svg)](https://github.com/BassT23/Proxmox/releases)
[![Discord](https://img.shields.io/discord/1149671790864506882)](https://discord.gg/nVpUg6BKn8)



Proxmox® is a registered trademark of Proxmox Server Solutions GmbH.
Expand All @@ -42,7 +33,7 @@ I am no member of the Proxmox Server Solutions GmbH. This is not an official pro
### Features:
- Update Proxmox VE (the host / all cluster nodes / all included LXCs and VMs)
- Normal run is "Interactive" / Headless Mode can be run with `update -s`
- Logging
- Logging to ``/var/log/update-"$HOSTNAME".log``
- Exit tracking, so you can send additional commands for finish or failure (edit files in `/root/Proxmox-Updater/exit`)
- [Config file](https://github.com/BassT23/Proxmox#config-file)

Expand All @@ -53,7 +44,8 @@ Changelog: [here](https://github.com/BassT23/Proxmox/blob/beta/change.log)

### What does the script do:
- The script make system updates with apt/dnf/pacman/apk or yum on all nodes/LXCs and VMs (if VMs prepared for that)
- After that it makes an little cleaning (like `apt autoremove`)
- Before the LXC/VM update start, there could be make a backup. This could be enabled in `update.conf`
- After all, the updater makes an little cleaning (like `apt autoremove`)
- If the script detects "extra" installations, it could update this also. (look in config file, for this)

##
Expand Down Expand Up @@ -91,7 +83,7 @@ So connect from first node (on which you install the Proxmox-Updater) to node2 w

2. Use ssh connection with Key-Based Authentication (a little more work, but nicer output and "extra" support)

more infos here: [SSH Connection](https://github.com/BassT23/Proxmox/blob/development/ssh.md)
more infos here: [SSH Connection](https://github.com/BassT23/Proxmox/blob/develop/ssh.md)


# Update the script:
Expand Down Expand Up @@ -150,4 +142,4 @@ To go back to master, choose `update -up`
[![grafik](https://user-images.githubusercontent.com/30832786/227482640-e7800e89-32a6-44fc-ad3b-43eef5cdc4d4.png)](https://ko-fi.com/basst)

# Credits:
[@Uruk](https://github.com/Uruknara) - for help with the code
[@Uruk](https://github.com/Uruknara) / [@elbim](https://github.com/elbim)
28 changes: 10 additions & 18 deletions change.log
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
Changelog:
==========

**v3.8.5** (beta)

**v3.9** (07.11.2023)
- make backup before update (must be enabled in config by user)
- code cleaning
- check internet connection on each LXC/VM
- config file:
- check for updates on excluded
- include phased updates
- make snapshot from LXC/VM before update (thanks to @elbim)

**v3.8.5** (18.06.2023)
- Skip node, if not reachable
- check internet status
- <update -up> will always use master version
- fix restore crontab, during uninstall
- fix version info

**v3.8.4** (01.04.2023)

- Speed up start in cluster mode
- Speed up installation
- Bug fixing
- Code cleaning

**v3.8** (28.03.2023)

- Add SSH Connection for VM - with extra update support
- Add "Global Extra" in config file, for disable/enable Extra Updates
- Info, if you are on beta/development version
Expand All @@ -31,7 +37,6 @@ Changelog:
- Add "reboot required"

**v3.7** (09.03.2023)

- Fixing code
- Support "only" LXC/VM
- Fix docker-compose update
Expand All @@ -40,64 +45,51 @@ Changelog:
- Need neofetch (will install automatic)

**v3.6** (22.02.2023)

- Add config file
- Cleaning code
- More colorful
- Fixing logging

**v3.4** (not released)

- Add VM Update
- Cleaning code
- Fixed Docker Update

**v3.3** (15.02.2023)

- Add Update Info
- Add extra Updates
- Add version check by user

**v3.1.1** (13.02.2023)

- Fixed update failure with CentOS

**v3.1** (12.02.2023)

- Add better usage
- Cleanup overall code

**v3.0** (10.02.2023)

- Implement single install url

**v2.8** (09.02.2023)

- Cleanup overall code

**v2.7.1** (06.02.2023)

- Small fixes

**v2.7** (31.01.2023)

- Add root check
- Cleanup overall code

**v2.6** (30.01.2023)

- Cleanup overall code
- Fix promt of update
- Add updating package that been kept back

**v2.5** (30.01.2023)

- Added "Headless Mode" as option with `update -3` otherwise runs in "Interactive Mode"

**v2.4** (29.01.2023)

- Visual and Name changes

**v2.3** (29.01.2023)

- Update script itself with `update -u`
11 changes: 6 additions & 5 deletions check-updates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Check Updates #
#################

VERSION="1.4.4"
VERSION="1.4.6"

#Variable / Function
CONFIG_FILE="/root/Proxmox-Updater/update.conf"
Expand Down Expand Up @@ -80,8 +80,10 @@ READ_WRITE_CONFIG () {
WITH_VM=$(awk -F'"' '/^WITH_VM=/ {print $2}' $CONFIG_FILE)
RUNNING=$(awk -F'"' '/^RUNNING_CONTAINER=/ {print $2}' $CONFIG_FILE)
STOPPED=$(awk -F'"' '/^STOPPED_CONTAINER=/ {print $2}' $CONFIG_FILE)
EXCLUDED=$(awk -F'"' '/^EXCLUDE=/ {print $2}' $CONFIG_FILE)
ONLY=$(awk -F'"' '/^ONLY=/ {print $2}' $CONFIG_FILE)
# EXCLUDED=$(awk -F'"' '/^EXCLUDE=/ {print $2}' $CONFIG_FILE)
# ONLY=$(awk -F'"' '/^ONLY=/ {print $2}' $CONFIG_FILE)
EXCLUDED=$(awk -F'"' '/^EXCLUDE_UPDATE_CHECK=/ {print $2}' $CONFIG_FILE)
ONLY=$(awk -F'"' '/^ONLY_UPDATE_CHECK=/ {print $2}' $CONFIG_FILE)
}

## HOST ##
Expand Down Expand Up @@ -359,8 +361,7 @@ else
fi

# Run
wget -q --spider http://google.com
if [ $? -eq 0 ]; then
if [[ "$(wget -q --spider http://google.com)" -eq 0 ]]; then
READ_WRITE_CONFIG
ARGUMENTS "$@"
else
Expand Down
22 changes: 11 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Install #
###########

VERSION="1.6.6"
VERSION="1.6.7"

# Branch
BRANCH="master"
Expand Down Expand Up @@ -132,7 +132,7 @@ INSTALL () {
echo -e "\n${BL}[Info]${GN} Installing Proxmox-Updater${CL}\n"
if [ -f "/usr/local/bin/update" ]; then
echo -e "${OR}Proxmox-Updater is already installed.${CL}"
read -p "Should I update for you? Type [Y/y] or Enter for yes - enything else will exit" -n 1 -r -s
read -p "Should I update for you? Type [Y/y] or Enter for yes - anything else will exit" -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ || $REPLY = "" ]]; then
bash <(curl -s $SERVER_URL/install.sh) update
else
Expand All @@ -159,7 +159,7 @@ INSTALL () {
echo -e "${OR}Finished. Run Proxmox-Updater with 'update'.${CL}"
echo -e "For infos and warnings please check the readme under <https://github.com/BassT23/Proxmox>\n"
echo -e "${OR}Also want to install the Welcome-Screen?${CL}\n\
Type [Y/y] or Enter for yes - enything else will exit"
Type [Y/y] or Enter for yes - anything else will exit"
read -p "" -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ || $REPLY = "" ]]; then
WELCOME_SCREEN_INSTALL
Expand All @@ -175,7 +175,7 @@ UPDATE () {
echo -e "${RD}Proxmox-Updater has changed directorys, so the old directory\n\
/root/Update-Scripts will be delete.${CL}\n\
${OR}Is it OK for you, or want to backup your files first?${CL}\n"
read -p "Type [Y/y] for DELETE - enything else will exit " -n 1 -r -s
read -p "Type [Y/y] for DELETE - anything else will exit " -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf /root/Update-Proxmox-Scripts || true
bash <(curl -s $SERVER_URL/install.sh) update
Expand All @@ -191,8 +191,8 @@ ${OR}Is it OK for you, or want to backup your files first?${CL}\n"
curl -s https://api.github.com/repos/BassT23/Proxmox/releases/latest | grep "browser_download_url" | cut -d : -f 2,3 | tr -d \" | wget -i - -q -O /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz
elif [[ "$BRANCH" == beta ]]; then
curl -s -L https://github.com/BassT23/Proxmox/tarball/beta > /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz
elif [[ "$BRANCH" == development ]]; then
curl -s -L https://github.com/BassT23/Proxmox/tarball/development > /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz
elif [[ "$BRANCH" == develop ]]; then
curl -s -L https://github.com/BassT23/Proxmox/tarball/develop > /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz
fi
tar -zxf /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz -C /root/Proxmox-Updater-Temp
rm -rf /root/Proxmox-Updater-Temp/Proxmox-Updater.tar.gz || true
Expand Down Expand Up @@ -239,7 +239,7 @@ ${OR}Is it OK for you, or want to backup your files first?${CL}\n"
else
# Install, because no installation found
echo -e "${RD}Proxmox-Updater is not installed.\n\n${OR}Would you like to install it?${CL}"
read -p "Type [Y/y] or Enter for yes - enything else will exit" -n 1 -r -s
read -p "Type [Y/y] or Enter for yes - anything else will exit" -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ || $REPLY = "" ]]; then
bash <(curl -s $SERVER_URL/install.sh)
else
Expand All @@ -257,7 +257,7 @@ CHECK_DIFF () {
Y or y : install the package maintainer's version (old file will be save as '$f.bak')\n \
N or n : keep your currently-installed version\n \
S or s : show the differences between the versions\n \
The default action is to keep your current version.\n \
The default action is to install new version and backup current file.\n \
*** $f (Y/y/N/n/S/s) [default=Y] ? "
read -p "" -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ || $REPLY = "" ]]; then
Expand All @@ -283,13 +283,13 @@ WELCOME_SCREEN () {
curl -s $SERVER_URL/check-updates.sh > /root/Proxmox-Updater-Temp/check-updates.sh
if ! [[ -f "/etc/update-motd.d/01-welcome-screen" && -x "/etc/update-motd.d/01-welcome-screen" ]]; then
echo -e "${OR} Welcome-Screen is not installed${CL}\n"
read -p "Would you like to install it also? Type [Y/y] or Enter for yes - enything else will skip" -n 1 -r -s && echo
read -p "Would you like to install it also? Type [Y/y] or Enter for yes - anything else will skip" -n 1 -r -s && echo
if [[ $REPLY =~ ^[Yy]$ || $REPLY = "" ]]; then
WELCOME_SCREEN_INSTALL
fi
else
echo -e "${OR} Welcome-Screen is already installed${CL}\n"
read -p "Would you like to uninstall it? Type [Y/y] for yes - enything else will skip" -n 1 -r -s && echo
read -p "Would you like to uninstall it? Type [Y/y] for yes - anything else will skip" -n 1 -r -s && echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf /etc/update-motd.d/01-welcome-screen || true
rm -rf /etc/motd || true
Expand Down Expand Up @@ -326,7 +326,7 @@ UNINSTALL () {
if [ -f /usr/local/bin/update ]; then
echo -e "\n${BL}[Info]${GN} Uninstall Proxmox-Updater${CL}\n"
echo -e "${RD}Really want to remove Proxmox-Updater?${CL}\n\
Type [Y/y] for yes - enything else will exit"
Type [Y/y] for yes - anything else will exit"
read -p "" -n 1 -r -s
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm /usr/local/bin/update
Expand Down
16 changes: 8 additions & 8 deletions update-extras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Update-Extras #
#################

VERSION="1.8.1"
VERSION="1.8.2"

# Variables
CONFIG_FILE="/root/Proxmox-Updater/update.conf"
Expand All @@ -27,12 +27,12 @@ if [[ -d "/opt/iobroker" && $IOBROKER == true ]]; then
echo "*** Update/Upgrade ioBroker ***" && iob update && iob upgrade -y && iob upgrade self -y && echo
echo "*** Start ioBroker ***" && iob start && echo
if [[ -d "/opt/iobroker/iobroker-data/radar2.admin" ]]; then
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which arp-scan`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which node`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which arp`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which hcitool`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which hciconfig`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip $(eval readlink -f `which l2ping`)
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which arp-scan)')"
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which node)')"
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which arp)')"
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which hcitool)')"
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which hciconfig)')"
setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which l2ping)')"
fi
fi

Expand Down Expand Up @@ -74,7 +74,7 @@ if [[ -d "/root/OctoPrint" && $OCTOPRINT == true ]]; then
echo -e "\n*** Updating Octoprint ***\n"
# find octoprint
OPRINT=$(find /home -name "oprint")
"$OPRINT"/bin/pip install -U octoprint
"$OPRINT"/bin/pip install -U --ignore-installed octoprint
sudo service octoprint restart
fi

Expand Down
25 changes: 23 additions & 2 deletions update.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# change 'true' or commend out with '#' #
################################################

VERSION="1.2"

VERSION="1.3.1"
VERSION_CHECK="true"
URL_FOR_INTERNET_CHECK="google.com"

################################################
# Host / LXC / VM #
Expand All @@ -20,6 +20,17 @@ WITH_VM="true"
STOPPED_CONTAINER="true"
RUNNING_CONTAINER="true"

INCLUDE_KERNEL="true"
INCLUDE_PHASED_UPDATES="false"

################################################
#This would need much more time for the script!#
# Better make Backups at night with the UI #
# change "false" to "true" to enable #
################################################

BACKUP="false"

################################################
# Extra Updates #
################################################
Expand All @@ -45,3 +56,13 @@ DOCKER_COMPOSE="true"

ONLY=""
EXCLUDE=""

################################################
# Update-Checker #
# Example: ONLY/EXCLUDE="100 110 120" #
################################################
# ! If 'ONLY' is set, 'EXCLUDE' don't work ! #
################################################

ONLY_UPDATE_CHECK=""
EXCLUDE_UPDATE_CHECK=""
Loading

0 comments on commit d365853

Please sign in to comment.