diff --git a/install.sh b/install.sh index 0cf242d..980bae8 100755 --- a/install.sh +++ b/install.sh @@ -88,5 +88,7 @@ install_exec pdist/pdist "$DESTDIR$usrlocal_bindir/pdis install_exec pmirror/pmirror "$DESTDIR$usrlocal_bindir/pmirror" install_exec prun/prun "$DESTDIR$usr_bindir/prun" install_exec put_websafe/put_websafe "$DESTDIR$usrlocal_bindir/put_websafe" +install_exec switch-passwd/switch-passwd "$DESTDIR$root_sbindir/switch-passwd" +install_data switch-passwd/switch-passwd.service "$DESTDIR$systemdunitdir/switch-passwd.service" exit diff --git a/switch-passwd/switch-passwd b/switch-passwd/switch-passwd new file mode 100755 index 0000000..0b147f8 --- /dev/null +++ b/switch-passwd/switch-passwd @@ -0,0 +1,11 @@ +#! /bin/sh +test -L /etc/passwd && exit +systemctl status gdm.service >/dev/null && exit + +set -e + +sed -e 's/passwd: files students nis/passwd: files students/' < /etc/nsswitch.conf > /etc/nsswitch.conf.new +ln -sf passwd.mariux /etc/passwd.new + +mv /etc/passwd.new /etc/passwd +mv /etc/nsswitch.conf.new /etc/nsswitch.conf diff --git a/switch-passwd/switch-passwd.service b/switch-passwd/switch-passwd.service new file mode 100644 index 0000000..7885a26 --- /dev/null +++ b/switch-passwd/switch-passwd.service @@ -0,0 +1,9 @@ +[Unit] +Before=gdm.service + +[Install] +WantedBy=basic.target + +[Service] +Type=oneshot +ExecStart=/sbin/switch-passwd