[fix] Only try to stop/remove containers if at least one exists

This commit is contained in:
William Wernert
2020-12-15 13:37:46 -05:00
parent e89c06f71b
commit 343e9f8b2c

View File

@@ -1525,9 +1525,11 @@ reinstall_init() {
if command -v docker &> /dev/null; then
# Stop and remove all so-* containers so files can be changed with more safety
if [ $(docker ps -a -q --filter "name=so-") -gt 0 ]; then
docker stop $(docker ps -a -q --filter "name=so-")
docker rm -f $(docker ps -a -q --filter "name=so-")
fi
fi
local date_string
date_string=$(date +%s)