Skip to content

Commit

Permalink
Add the sdffs scritp and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ataliba committed May 7, 2001
1 parent 29e6a07 commit c145343
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sdf-utils/sdffs/sdffs.config
@@ -0,0 +1,14 @@
# Change this to your local user id and local groupd id
UserID=
GroupID=
# Change this to your user on SDF
SDFID=
# Change this to your home path on SDF
RemotePath=
LocalPath=
# Change this to the server you connect on SDF
Server=
# Change this to the server your connect on port 443 on SDF
Server443=
# Change this to all sleep use on this script
Sleep=1
75 changes: 75 additions & 0 deletions sdf-utils/sdffs/sdffs.sh
@@ -0,0 +1,75 @@
#!/bin/sh

source $HOME/.myscripts/sdffs

# Version of the script
Version=29

case $1 in

mount)

if [ ! -e $LocalPath ]; then
echo -n "Creating the mounting dir "
sudo mkdir -p $LocalPath
sudo chown -R $UserID:$GroupID $LocalPath
sleep $Sleep
echo -e "\033[40;31;1;5m [ Ok ] \033[m"
fi

PStat=$(ps aux | grep sshfs | grep -v grep | grep "$RemotePath")
if [ "$PStat" == "" ]; then

echo -n "Mount your dir at SDF Public Access Unix System"
if [ -z $2 ];
then
/usr/bin/sshfs $SDFID@$Server:$RemotePath \
$LocalPath
else
/usr/bin/sshfs -p $2 $SDFID@$Server443:$RemotePath \
$LocalPath
fi

echo -e "\033[40;31;1;5m [ Enjoy !!! ] \033[m"

else
echo "Your dir at SDF Public Access Unix System is already mounted "
fi

;;
umount)
PStat=$(ps aux | grep sshfs | grep -v grep | grep "$RemotePath")
if [ "$PStat" != "" ]; then

echo -n "Umount your dir at SDF Public Access Unix System"
sudo /bin/umount $LocalPath
sleep $Sleep
echo -e "\033[40;31;1;5m [ Ok ] \033[m"
else
echo "Your dir isn't mounted at SDF Public Access Unix System"
fi

;;

status)
PStat=$(ps aux | grep sshfs | grep -v grep | grep "$RemotePath")
if [ "$PStat" != "" ]; then
Status=" Online"
else
Status=" Offline"
fi

echo -e "Status of sdffs service is \033[40;34;1;5m $Status \033[m"
if [ "$Status" = " Online" ]; then
echo $PStat | awk -F" " '{print "\033[40;34;1;5mRemote FS: \033[m" $12" \033[40;34;1;5mMounted on: \033[m"$13}'
fi
;;
update)
Check_Version
;;
*)
echo -e "Script Version \033[40;34;1;5m$Version\033[m"
echo "Use: $0 mount [port]"
echo " $0 umount "
;;
esac

0 comments on commit c145343

Please sign in to comment.