• Michael Shigorin's avatar
    deflogin: refactoring and fixup · 54609e47
    Michael Shigorin authored
    There have been several problems with this feature:
    - a typo;
    - non-existant GROUPS (even a single one) would block setting
      all of the supplementary groups but separately-set 'wheel';
    - this feature isn't used much actually so sees no battle testing.
    
    The typo has been just fixed; GROUPS are now applied by iteration
    which is less effective but more reliable; an additional script
    hook to write down login invitation for the first passwordless
    account (if any) has been implemented; and several more group
    managing targets have been added (based on live feature's script).
    54609e47
50-issue 409 Bytes
#!/bin/sh
# issue welcome message if there's a guest user
# (the first one configured with empty password)

[ -n "$GLOBAL_USERS" ] || exit 1

guest=
for u in $GLOBAL_USERS; do
	login="${u%%:*}"
	[ -n "$login" ] || continue
	rest="${u#*:}"
	pass="${rest%%:*}"
	[ -z "$pass" ] || continue
	guest="$login"
	break
done

[ -n "$guest" ] || exit 0

echo "Hello friend, say \`$guest' to log in at \\l" >> /etc/issue