ssfs view ssfs-sh @ rev 33

Tiny edits
author Paul Issott <paul@slitaz.org>
date Sun Jun 12 12:02:48 2011 +0100 (2011-06-12)
parents 8727a2a80b10
children c7205f3db649
line source
1 #!/bin/sh
2 #
3 # Ssfs users SHell - Chroot user into the virtual disk on login. This tool must
4 # be installed on the server and in the vdisk chroot, it is executed when logging
5 # in and when chrooting.
6 #
8 # Ssfs server config doesn't exist in chroot.
9 if [ -f /etc/ssfs/ssfs-server.conf ]; then
10 . /etc/ssfs/ssfs-server.conf
11 root=$SSFS_CHROOT
12 # Make sure it's a valid Ssfs user.
13 [ -d "$root/home/$USER" ] || exit 0
14 clear && exec chroot $root /bin/ssfs-sh
15 else
16 # Chroot will drop user into /, so set new HOME and cd. Set also
17 # some env variables but don't source any profile.
18 echo -e "\nWelcome to the Ssfs SHell $USER\n"
19 HOME=/home/$USER
20 SYNC=$HOME/Sync
21 SHELL=/bin/sh
22 PS1='\u@ssfs:\e[1;33m\w\e[0m\$ '
23 export HOME SYNC SHELL PS1
24 cd $HOME && exec /bin/sh $@
25 fi