ssfs annotate ssfs-sh @ rev 89
beginning french translation for ssfs-server
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Wed Dec 19 10:54:15 2012 +0100 (2012-12-19) |
parents | 86891a868e9d |
children |
rev | line source |
---|---|
pankso@29 | 1 #!/bin/sh |
pankso@29 | 2 # |
pankso@29 | 3 # Ssfs users SHell - Chroot user into the virtual disk on login. This tool must |
paul@33 | 4 # be installed on the server and in the vdisk chroot, it is executed when logging |
paul@33 | 5 # in and when chrooting. |
pankso@29 | 6 # |
pankso@40 | 7 # Copyright (C) SliTaz GNU/Linux - BSD License |
pankso@40 | 8 # Author: Christophe Lincoln <pankso@slitaz.org> |
pankso@40 | 9 # |
pankso@29 | 10 |
pankso@45 | 11 # Handle rsync first, user is chrooted after. |
pankso@45 | 12 case "$@" in |
pankso@45 | 13 *rsync*) exec /bin/sh "$@" ;; |
pankso@47 | 14 *help) echo "Usage: $(basename $0) [args]" && exit 0 ;; |
pankso@45 | 15 esac |
pankso@45 | 16 |
paul@33 | 17 # Ssfs server config doesn't exist in chroot. |
pankso@29 | 18 if [ -f /etc/ssfs/ssfs-server.conf ]; then |
pankso@29 | 19 . /etc/ssfs/ssfs-server.conf |
pankso@29 | 20 root=$SSFS_CHROOT |
pankso@29 | 21 # Make sure it's a valid Ssfs user. |
pankso@29 | 22 [ -d "$root/home/$USER" ] || exit 0 |
pankso@46 | 23 exec chroot $root /bin/ssfs-sh "$@" |
pankso@29 | 24 else |
pankso@29 | 25 # Chroot will drop user into /, so set new HOME and cd. Set also |
paul@33 | 26 # some env variables but don't source any profile. |
pankso@58 | 27 clear && echo -e \ |
pankso@58 | 28 "\n\033[1m Welcome to the Ssfs SHell $USER\033[0m\n" |
pankso@68 | 29 PS1='\u@ssfs\e[0m:\e[1;34m\w\e[0m\$ ' |
pankso@68 | 30 PATH='/bin' |
pankso@29 | 31 HOME=/home/$USER |
pankso@29 | 32 SYNC=$HOME/Sync |
pankso@29 | 33 SHELL=/bin/sh |
pankso@56 | 34 export PS1 PATH HOME SYNC SHELL |
pankso@42 | 35 cd $HOME |
pankso@46 | 36 exec /bin/sh "$@" |
pankso@29 | 37 fi |