[ -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;}')
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
# --uboot-addr=ramdisk=0x83100000
# "
CONFIG_EOF
+chown $user: $home/.novaboot-shell
+
+if [ -d /run/systemd/system ]; then
+ cat <<EOF
+To enable automatic delayed power-off run 'systemctl --user enable novaboot-delayed-power-off'
+as the created user (e.g. via shell subcommand)
+EOF
+ # TODO: Add a way to run in automatically from here (allow shell
+ #subcommand to accept command lines)
+ #systemctl --user enable novaboot-delayed-power-off
+fi
+
+
echo "Done"
exit 0
=item --admin-id NAME
User name associated with the key. This user name is shown to
-connecting users when the target is occupied.
+connecting users when the target is occupied by the administrator.
+When omitted, I<admin> is used as the user name.
=back