+# 1 = install, 2 = upgrade/reinstall
+if [ $1 -ge 1 ]; then
+ # create the magic directory for automount
+ keydir=/var/pl_sshd/keys
+
+ # add appropriate entry to auto.master
+ auto_master=/etc/auto.master
+ auto_master_entry="$keydir /etc/auto.pl_sshd"
+ grep -qF "$auto_master_entry" $auto_master || \
+ echo $auto_master_entry >>$auto_master
+
+ #
+ # use the sysconfig file to tell our system sshd to look in the
+ # magic location for authorized_keys files
+ #
+ sysconfig_sshd=/etc/sysconfig/sshd
+ [ -r $sysconfig_sshd ] && \
+ mv $sysconfig_sshd $sysconfig_sshd.pl_sshd
+ echo "OPTIONS='-o \"AuthorizedKeysFile $keydir/%u/authorized_keys\"'" \
+ >$sysconfig_sshd
+
+ # link sshd pam config to pl_sshd so that we can actually login
+ pam_pl_sshd=/etc/pam.d/pl_sshd
+ [ -r $pam_pl_sshd ] || ln -s sshd $pam_pl_sshd
+
+ chkconfig --add pl_sshd
+
+ if [[ "$RUNLEVEL" != "unknown" ]]; then
+ #
+ # don't try to start/restart various things automatically,
+ # it's too ugly (particularly if we're upgrading while
+ # connected over ssh)
+ #
+ echo
+ echo "You need to manually restart autofs and sshd, and"
+ echo "start the pl_sshd (ssh on port 806) service."
+ echo "Make sure you know what you're doing, particularly"
+ echo "if you're making this change over an ssh connection."
+ echo
+ fi