add snap app refresh

This commit is contained in:
2024-02-05 20:50:25 +01:00
parent 594e05bf5c
commit d3bbc8380d
3 changed files with 46 additions and 1 deletions

View File

@@ -28,6 +28,9 @@ for i in $(lxc list type=container -c ns --format csv); do
sleep 2
lxc exec ${cont_name} -- sh -c "apt autoremove"
sleep 2
echo -e $(date) "- Refresh snap packages"
lxc exec ${cont_name} -- bash -c "if [[ \$(which snap > /dev/null; echo \$?) == 0 ]]; then snap refresh ; fi"
if [ "${i#*,}" == "STOPPED" ]; then
echo $(date) "- Stop container ${cont_name}"
stop_container ${cont_name} &