github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/debian/docker.io.postinst (about) 1 #!/bin/sh 2 set -e 3 4 case "$1" in 5 configure) 6 # Make sure the "docker" system group exists for "docker.socket" 7 # to apply it as the group on "docker.sock" 8 if ! getent group docker >/dev/null 2>&1 ; then 9 addgroup --system docker 10 fi 11 for users in $(awk -F: '/\/home/ {printf "%s:%s\n",$1,$3}' /etc/passwd | cut -d: -f1) 12 do 13 usermod -a -G docker $users || true 14 done 15 16 # Ensure config directory permissions 17 # On a fresh install, $2 = '' and dpkg "le-nl" treat that as a 18 # greater version, so the body is not executed. 19 if dpkg --compare-versions "$2" le-nl '1.11.2~ds1-1'; then 20 if [ "$(stat -c '%a' /etc/docker)" = '700' ]; then 21 chmod 0755 /etc/docker 22 fi 23 fi 24 ;; 25 abort-*) 26 # How'd we get here?? 27 exit 1 28 ;; 29 *) 30 ;; 31 esac 32 33 #DEBHELPER#