Merge pull request #31 from Heavybullets8:version_based_prune
prune based on current version
This commit is contained in:
commit
211fb7b488
@ -18,9 +18,15 @@ export -f sync
|
|||||||
|
|
||||||
prune(){
|
prune(){
|
||||||
echo -e "🄿 🅁 🅄 🄽 🄴"
|
echo -e "🄿 🅁 🅄 🄽 🄴"
|
||||||
echo "Pruned Docker Images"
|
version="$(cli -c 'system version' | awk -F '-' '{print $3}' | tr -d " \t\r\.")"
|
||||||
if ! cli -c 'app container config prune prune_options={"remove_unused_images": true, "remove_stopped_containers": true}' | head -n -4; then
|
if (( "$version" <= 22120 )); then
|
||||||
echo "Failed to Prune Docker Images"
|
if ! cli -c 'app container config prune prune_options={"remove_unused_images": true, "remove_stopped_containers": true}' | head -n -4; then
|
||||||
|
echo "Failed to Prune Docker Images"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! docker image prune -af | grep "^Total"; then
|
||||||
|
echo "Failed to Prune Docker Images"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
export -f prune
|
export -f prune
|
||||||
|
Loading…
Reference in New Issue
Block a user