Skip to content

Instantly share code, notes, and snippets.

@iarp
Created June 4, 2024 19:45
Show Gist options
  • Save iarp/0ee5c45902fb53890f2bd7373b170e42 to your computer and use it in GitHub Desktop.
Save iarp/0ee5c45902fb53890f2bd7373b170e42 to your computer and use it in GitHub Desktop.
Stop unraid's docker containers bottom up.
sed '1!G;h;$!d' "/boot/config/plugins/dockerMan/userprefs.cfg" | while read line || [[ -n $line ]];
do
# do something with $line here
tmp=${line#*\"} # Remove everything up to and including first =
container_name=${tmp::-1}
echo "Stopping $container_name"
docker stop -t 30 $container_name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment