This commit was generated by cvs2svn to compensate for changes in r5,
[pl_sshd.git] / auto.pl_sshd
1 #!/bin/bash
2 #
3 # script to translate keys (user names) into automount rules.
4 #
5
6 [ "$#" = "1" ] || { echo bad args; exit 1; }
7
8 KEYFILE=.ssh/authorized_keys
9 eval "HOMEDIR=~$1"  # the way that ~ substitution works
10
11 #
12 # if this user has a file .ssh/authorized_keys within their real homedir
13 # then return that, otherwise use the corresponding file from the vserver.
14 #
15 if [ -r "$HOMEDIR/$KEYFILE" ]; then
16     OUT=$HOMEDIR/.ssh
17 elif [ -r "/vservers/$1/home/$1/$KEYFILE" ]; then
18     OUT=/vservers/$1/home/$1/.ssh
19 else
20     echo $1 not found in /vservers or /home >/tmp/auto.pl_sshd.log
21     exit 1
22 fi
23
24 echo --bind,-r :$OUT