This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/env/arch-linux/provisioning/0-adduser.bash

16 lines
390 B
Bash
Executable file

#!/usr/bin/env bash
USERNAME=daniel
GROUPS="admin,users"
groupadd admin 2>/dev/null
mkdir --parents "/home/$USERNAME/.home"
mkdir --parents "/home/$USERNAME/dl"
useradd --home-dir "/home/$USERNAME/.home" \
--groups "${GROUPS}" \
--shell "/bin/bash" \
"$USERNAME"
chown --recursive "$USERNAME:$USERNAME" "/home/$USERNAME"
echo "Setting password for user '$USERNAME'"
passwd "$USERNAME"