Skip to content

Instantly share code, notes, and snippets.

@sangdongvan
Created April 19, 2019 02:41
Show Gist options
  • Save sangdongvan/1322837fcc24398c101300cee1268007 to your computer and use it in GitHub Desktop.
Save sangdongvan/1322837fcc24398c101300cee1268007 to your computer and use it in GitHub Desktop.
ubuntu check and create group/user
#!/bin/sh
# ubuntu
# check that owner group exists
if [ -z `getent group spinnaker` ]; then
groupadd spinnaker
fi
# check that user exists
if [ -z `getent passwd spinnaker` ]; then
useradd --gid spinnaker spinnaker -m --home-dir /home/spinnaker
fi
install --mode=755 --owner=spinnaker --group=spinnaker --directory /var/log/spinnaker/fiat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment