Skip to content

Commit

Permalink
Merge pull request #16 from mariux64/add-switch-passwd
Browse files Browse the repository at this point in the history
Add switch-passwd
  • Loading branch information
pmenzel authored Dec 11, 2017
2 parents e287015 + 47d9bdf commit c849508
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions switch-passwd/switch-passwd
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions switch-passwd/switch-passwd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Before=gdm.service

[Install]
WantedBy=basic.target

[Service]
Type=oneshot
ExecStart=/sbin/switch-passwd

0 comments on commit c849508

Please sign in to comment.