]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - server/adduser-novaboot
nix: Update flake inputs
[novaboot.git] / server / adduser-novaboot
index 9c8d5ff9aa511a2de03771eb14ecd951754d40d1..7d6a483fc8c6a3f21b0143bcbf78a787220c02e6 100755 (executable)
@@ -49,7 +49,7 @@ fi
 [ -z "$key" -o "$(echo "$key" | wc -l)" -ne 1 ] && die "--key needs to be just one line"
 echo "$key" | grep -q ssh || die "--key does not look like an SSH public key"
 
-adduser --disabled-password --shell $(which novaboot-shell) $adduser_opts "$@"
+adduser --disabled-password --ingroup novaboot --shell $(which novaboot-shell) $adduser_opts "$@"
 
 user="$1"
 home=$(getent passwd "$user"|awk -F: '{print $6;}')
@@ -69,16 +69,6 @@ else
     echo "NOT creating /srv/tftp/$user and symlink to it from $home/tftproot."
 fi
 
-if [ -d /run/systemd/system ]; then
-    echo "Installing systemd services and timers in /etc/systemd/system/user@$uid.service.d"
-    mkdir -p /etc/systemd/system/user@$uid.service.d
-    cat <<EOF > /etc/systemd/system/user@$uid.service.d/novaboot-server.conf
-[Unit]
-Requires=novaboot-server-login@$user.service
-After=novaboot-server-login@$user.service
-EOF
-fi
-
 echo "Creating configuration template in $home/.novaboot-shell"
 cat <<'CONFIG_EOF' > $home/.novaboot-shell
 #!/bin/sh
@@ -102,5 +92,13 @@ cat <<'CONFIG_EOF' > $home/.novaboot-shell
 # --uboot-addr=ramdisk=0x83100000
 # "
 CONFIG_EOF
+chown $user: $home/.novaboot-shell
+
+if [ -d /run/systemd/system ]; then
+    cat <<EOF
+See adduser-novaboot(8) for instructions how to automatically power of
+the target.
+EOF
+fi
 
 echo "Done"