Skip to content

Instantly share code, notes, and snippets.

@stesh
Created June 25, 2012 22:48
Show Gist options
  • Save stesh/2991959 to your computer and use it in GitHub Desktop.
Save stesh/2991959 to your computer and use it in GitHub Desktop.
#!/bin/sh
for user in $(cut -d ':' -f 1 /etc/passwd); do
if [ $(id -u $user) -ge 1000 ]; then
if [ -z $(getent group $user) ]; do
addgroup "$user"
fi
usermod -g "$user" "$user"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment