diff options
| author | Radon Rosborough <radon.neon@gmail.com> | 2022-01-05 15:35:12 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-05 15:35:12 -0800 |
| commit | 53f243b111b18f49d910d1501b5795a1ec045420 (patch) | |
| tree | 785538e39d04a00bc43507224f0ad6a4c89f297d /scripts/docker-pid1.bash | |
| parent | 41fa1f70ee01cd2ab3ab90f6fe4c4fc0819c2f96 (diff) | |
Add formatter tests (#72)
Closes #24
Builds on #25 by @PrimaryCanary
Diffstat (limited to 'scripts/docker-pid1.bash')
| -rwxr-xr-x | scripts/docker-pid1.bash | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/docker-pid1.bash b/scripts/docker-pid1.bash new file mode 100755 index 0000000..cee0dff --- /dev/null +++ b/scripts/docker-pid1.bash @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -euo pipefail + +cat <<"EOF" > /etc/sudoers.d/apheleia +%sudo ALL=(ALL:ALL) NOPASSWD: ALL +EOF + +groupadd -g "$(stat -c %g "$PWD")" -o -p '!' -r apheleia +useradd -u "$(stat -c %u "$PWD")" -g "$(stat -c %g "$PWD")" \ + -o -p '!' -m -N -l -s /usr/bin/bash -G sudo apheleia + +runuser -u apheleia touch /home/apheleia/.sudo_as_admin_successful + +if (( "$#" == 0 )) || [[ -z "$1" ]]; then + set -- bash +fi + +if (( "$#" == 1 )) && [[ "$1" == *" "* ]]; then + set -- bash -c "$1" +fi + +exec runuser -u apheleia -- "$@" |
