mirror of https://github.com/tteck/Proxmox.git
Compare commits
2 Commits
c47326ff25
...
c18d373ff7
Author | SHA1 | Date |
---|---|---|
|
c18d373ff7 | |
|
dc4e460b3c |
|
@ -2,6 +2,12 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## 2023-03-08
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,7 @@ while true; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
clear
|
clear
|
||||||
exclude_container="$@"
|
excluded_containers=("$@")
|
||||||
containers=$(pct list | tail -n +2 | cut -f1 -d' ' | grep -vE "^($exclude_container)$")
|
|
||||||
function update_container() {
|
function update_container() {
|
||||||
container=$1
|
container=$1
|
||||||
header_info
|
header_info
|
||||||
|
@ -50,7 +49,19 @@ function update_container() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
header_info
|
header_info
|
||||||
for container in $containers; do
|
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)
|
status=$(pct status $container)
|
||||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||||
|
@ -64,6 +75,7 @@ for container in $containers; do
|
||||||
elif [ "$status" == "status: running" ]; then
|
elif [ "$status" == "status: running" ]; then
|
||||||
update_container $container
|
update_container $container
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
header_info
|
header_info
|
||||||
|
|
Loading…
Reference in New Issue