mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "c18d373ff75c2af44201112ea4089c87e98c577b" and "c47326ff2544b6a507f670b70b32ecbbb71204d7" have entirely different histories.
c18d373ff7
...
c47326ff25
|
@ -2,12 +2,6 @@
|
|||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 2023-03-10
|
||||
|
||||
### Changed
|
||||
|
||||
- **Proxmox LXC Updater**
|
||||
- You can use the command line to exclude multiple containers simultaneously.
|
||||
|
||||
## 2023-03-08
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ while true; do
|
|||
esac
|
||||
done
|
||||
clear
|
||||
excluded_containers=("$@")
|
||||
exclude_container="$@"
|
||||
containers=$(pct list | tail -n +2 | cut -f1 -d' ' | grep -vE "^($exclude_container)$")
|
||||
function update_container() {
|
||||
container=$1
|
||||
header_info
|
||||
|
@ -49,22 +50,10 @@ function update_container() {
|
|||
esac
|
||||
}
|
||||
header_info
|
||||
for container in $(pct list | tail -n +2 | cut -f1 -d' '); do
|
||||
excluded=false
|
||||
for excluded_container in "${excluded_containers[@]}"; do
|
||||
if [ "$container" == "$excluded_container" ]; then
|
||||
excluded=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "$excluded" == true ]; then
|
||||
header_info
|
||||
echo -e "${BL}[Info]${GN} Skipping ${BL}$container${CL}"
|
||||
sleep 1
|
||||
else
|
||||
status=$(pct status $container)
|
||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||
for container in $containers; do
|
||||
status=$(pct status $container)
|
||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||
if [ "$template" == "false" ] && [ "$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"
|
||||
|
@ -74,7 +63,6 @@ for container in $(pct list | tail -n +2 | cut -f1 -d' '); do
|
|||
pct shutdown $container &
|
||||
elif [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
fi
|
||||
fi
|
||||
done
|
||||
wait
|
||||
|
|
Loading…
Reference in New Issue