This repository has been archived on 2024-12-14. You can view files and clone it, but cannot push or open issues or pull requests.
2023-01-28 00:05:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
uid=${UID?}
|
|
|
|
gid=${GID?}
|
|
|
|
user=${USER:-"build"}
|
|
|
|
export HOME="/home/${user}"
|
|
|
|
|
2023-04-03 04:09:46 +00:00
|
|
|
groupdel dialout
|
2023-01-28 00:05:03 +00:00
|
|
|
groupadd -g "$gid" "${user}"
|
|
|
|
useradd \
|
|
|
|
-g "$gid" \
|
2023-04-13 21:20:55 +00:00
|
|
|
-G sudo \
|
2023-01-28 00:05:03 +00:00
|
|
|
-u "$uid" \
|
2023-03-08 02:09:52 +00:00
|
|
|
-d "/home/${user}" \
|
2023-01-28 00:05:03 +00:00
|
|
|
-s /bin/bash \
|
|
|
|
"${user}"
|
|
|
|
|
|
|
|
cd "$HOME"
|
|
|
|
setpriv --reuid="$uid" --regid="$gid" --init-groups "$@"
|