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/bin/lib/arch-linux/provisioning/0-adduser.bash

16 lines
390 B
Bash
Raw Normal View History

#!/usr/bin/env bash
USERNAME=daniel
2020-11-01 19:12:11 -06:00
GROUPS="admin,users"
groupadd admin 2>/dev/null
2020-11-01 19:12:11 -06:00
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"