Sunday 27 July 2014

Ubuntu - SSHFS scripts

Hello,

This is small script for mount and unmount directory from your server:
  • Create script:
    • mkdir server
    • vim mount-server.sh
      • #!/bin/bash
        
        ACTION=$1
        
        if [ "$ACTION" == "mount" ]; then
            sshfs -o "IdentityFile=~/Desktop/Public-Key.pem" ubuntu@xxx.xxx.xxx.xxx:/home/web/ ~/www/server/
            echo "Mounted!"
        else
            fusermount -u server
            echo "Unmounted!"
        fi
    • chmod +x mount-server.sh
  • Usage:
    • Mount: ./mount-server.sh mount
    • Unmount: ./mount-server.sh unmount
  • Check server folder

Good luck!

1 comment:

  1. I really like your modern http://www.assignment-help-sydney.com/australianwritings-com-review/ stylish ideas which you have shared about manipulative. This blog provide extraordinary and exact information for which I was searching

    ReplyDelete