ssfs rev 55

ssfs: add connect command
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jun 12 20:55:51 2011 +0200 (2011-06-12)
parents 082c86920b7b
children 217499067412
files README ssfs ssfs-box ssfs-server
line diff
     1.1 --- a/README	Sun Jun 12 20:34:42 2011 +0200
     1.2 +++ b/README	Sun Jun 12 20:55:51 2011 +0200
     1.3 @@ -33,7 +33,8 @@
     1.4      * Fast and light using stable and mature GNU tools
     1.5      * Encrypted file tranfert using SSH protocol
     1.6      * Easy to setup on the client and server side
     1.7 -    * Virtual disk for storage with a minimal chroot
     1.8 +    * Virtual disk for storage for quoto mamagement
     1.9 +    * Minimal and restrictive but yet powerfull chroot
    1.10      * Command line chrooted SSH access for users
    1.11      * Easy to backup, update and maintain vdisk
    1.12  
     2.1 --- a/ssfs	Sun Jun 12 20:34:42 2011 +0200
     2.2 +++ b/ssfs	Sun Jun 12 20:55:51 2011 +0200
     2.3 @@ -41,6 +41,7 @@
     2.4    setup         $(gettext "Setup client configuration and RSA key.")
     2.5    sync          $(gettext "Sync from server and start daemon.")
     2.6    stop          $(gettext "Stop monitoring ~/Sync folder.")
     2.7 +  connect       $(gettext "Connect to remote host via SSH.")
     2.8  
     2.9  $(echo -e "\033[1m$(gettext "Options:")\033[0m")
    2.10    --login=      $(gettext "Login name on remote host.")
    2.11 @@ -70,6 +71,12 @@
    2.12  EOT
    2.13  }
    2.14  
    2.15 +get_config() {
    2.16 +	at=$(fgrep host $config | cut -d '"' -f 2)
    2.17 +	login=${at%@*}
    2.18 +	host=${at#*@}
    2.19 +}
    2.20 +
    2.21  #
    2.22  # Commands
    2.23  #
    2.24 @@ -99,7 +106,7 @@
    2.25  		
    2.26  		# Upload key to the server.
    2.27  		gettext "Sending RSA secure key to:"; echo " $host"
    2.28 -		gettexz "Please enter you Ssfs password."
    2.29 +		gettext "Please enter you Ssfs password."
    2.30  		echo -e "\n"
    2.31  		cat $HOME/.ssh/id_rsa.pub | \
    2.32  			ssh $login@$host 'cat - >> ~/.ssh/authorized_keys' || exit 1
    2.33 @@ -133,6 +140,10 @@
    2.34  		gettext "Stopping"; echo " $app PID: $kill"
    2.35  		kill $kill 2>/dev/null
    2.36  		rm -f $pid ;;
    2.37 +	connect)
    2.38 +		# Connect user to Ssfs server via SSH.
    2.39 +		get_config
    2.40 +		ssh $login@$host ;;
    2.41  	*)
    2.42  		help ;;
    2.43  esac
     3.1 --- a/ssfs-box	Sun Jun 12 20:34:42 2011 +0200
     3.2 +++ b/ssfs-box	Sun Jun 12 20:55:51 2011 +0200
     3.3 @@ -89,7 +89,7 @@
     3.4  	host=$(echo $main | cut -d '|' -f 2)
     3.5  	[ "$host" ] || exit 0
     3.6  	rm -f $config
     3.7 -	terminal -hold -geometry 76x16 -T "Ssfs connection" \
     3.8 +	terminal -hold -geometry 76x16 -T "Ssfs" \
     3.9  		-e "ssfs setup --login=$login --host=$host"
    3.10  }
    3.11  
     4.1 --- a/ssfs-server	Sun Jun 12 20:34:42 2011 +0200
     4.2 +++ b/ssfs-server	Sun Jun 12 20:55:51 2011 +0200
     4.3 @@ -62,6 +62,7 @@
     4.4    check-vdisk   $(gettext "Check the vdisk filesystem with e2fsck.")
     4.5    mount-vdisk   $(gettext "Mount a ssfs virtual disk.")
     4.6    umount-vdisk  $(gettext "Unmount the vdisk and free loop device.")
     4.7 +  note          $(gettext "Write a public note for users.")
     4.8  
     4.9  $(echo -e "\033[1m$(gettext "Options:")\033[0m")
    4.10    --login=      $(gettext "Login name to add or del an user.")