Created
October 30, 2024 07:57
-
-
Save jonasbjork/5fb03e3c367d8af4f7569e63844e3dc9 to your computer and use it in GitHub Desktop.
Ett bash exempel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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