Skip to content

Instantly share code, notes, and snippets.

@jonasbjork
Created October 30, 2024 07:57
Show Gist options
  • Save jonasbjork/5fb03e3c367d8af4f7569e63844e3dc9 to your computer and use it in GitHub Desktop.
Save jonasbjork/5fb03e3c367d8af4f7569e63844e3dc9 to your computer and use it in GitHub Desktop.
Ett bash exempel
#!/usr/bin/env bash
if [ $EUID -ne 0 ] ; then
echo "You need to run this as root! (use the sudo)"
exit 1
fi
if [ $# -lt 1 ] ; then
echo "You need to specify username"
exit 1
fi
useradd -m -s /bin/bash -c "user $1, created by script" $1
passwd $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment