aboutsummaryrefslogtreecommitdiff
path: root/store/debian-dev/setup/for-container.bash
diff options
context:
space:
mode:
authorYuqian Yang <crupest@outlook.com>2025-06-29 15:07:57 +0800
committerYuqian Yang <crupest@outlook.com>2025-06-29 15:08:47 +0800
commit66a0836ba12ed12c29353ae75134654c6f2013cc (patch)
treeaeca0ebfca99f50f305f8948f512abf1760f8540 /store/debian-dev/setup/for-container.bash
parent43d6c1f08a38ae4e8584e3915f0cbdbc3cfd05e9 (diff)
downloadcrupest-66a0836ba12ed12c29353ae75134654c6f2013cc.tar.gz
crupest-66a0836ba12ed12c29353ae75134654c6f2013cc.tar.bz2
crupest-66a0836ba12ed12c29353ae75134654c6f2013cc.zip
debian-dev: refactor all.
Diffstat (limited to 'store/debian-dev/setup/for-container.bash')
-rwxr-xr-xstore/debian-dev/setup/for-container.bash14
1 files changed, 14 insertions, 0 deletions
diff --git a/store/debian-dev/setup/for-container.bash b/store/debian-dev/setup/for-container.bash
new file mode 100755
index 0000000..0aa47b0
--- /dev/null
+++ b/store/debian-dev/setup/for-container.bash
@@ -0,0 +1,14 @@
+#! /usr/bin/env bash
+
+set -e -o pipefail
+
+echo "set up locale"
+localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+
+echo "set up sudo"
+sed -i.bak 's|%sudo[[:space:]]\+ALL=(ALL:ALL)[[:space:]]\+ALL|%sudo ALL=(ALL:ALL) NOPASSWD: ALL|' /etc/sudoers
+
+if ! id "username" &>/dev/null; then
+ echo "create user $CRUPEST_DEBIAN_DEV_USER"
+ useradd -m -G sudo -s /usr/bin/bash "$CRUPEST_DEBIAN_DEV_USER"
+fi