added TARGET_USERNAME from autoinstall yaml
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_USER=${TARGET_USERNAME:?must defined}
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
@@ -43,7 +44,7 @@ function docker() {
|
||||
apt-get update -qq
|
||||
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
|
||||
usermod -aG docker alfoldi
|
||||
usermod -aG docker "$TARGET_USER"
|
||||
systemctl enable docker
|
||||
info "Docker installed."
|
||||
echo docker >>/tmp/installer
|
||||
@@ -135,7 +136,7 @@ function main() {
|
||||
|
||||
# ─── DASH TO PANEL ───────────────────────────────────────────────────────────
|
||||
info "Installing Dash to Panel..."
|
||||
sudo -u alfoldi bash -c '
|
||||
sudo -u "$TARGET_USER" bash -c '
|
||||
cd /tmp
|
||||
git clone https://github.com/home-sweet-gnome/dash-to-panel.git || true
|
||||
cd dash-to-panel
|
||||
@@ -148,10 +149,10 @@ function main() {
|
||||
info "Enabling SSH..."
|
||||
systemctl enable ssh
|
||||
|
||||
# ─── (passwordless for alfoldi) ─────────────────────────────────────────
|
||||
# ─── (passwordless for "$TARGET_USER") ─────────────────────────────────────────
|
||||
info "Configuring sudoers..."
|
||||
echo 'alfoldi ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/alfoldi
|
||||
chmod 440 /etc/sudoers.d/alfoldi
|
||||
echo "$TARGET_USER ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/$TARGET_USER"
|
||||
chmod 440 "/etc/sudoers.d/$TARGET_USER"
|
||||
|
||||
info "Post-install complete ✓"
|
||||
systemctl start gdm
|
||||
|
||||
Reference in New Issue
Block a user