Skip to content

Commit

Permalink
Add mount_remote usage and unmount functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
nrsyed committed Oct 21, 2021
1 parent 429731c commit 5f517ad
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions tools/mount_remote.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
#!/bin/bash

usage() {
printf ""
NF='\e[0m' # no formatting
BOLD='\e[1m'
SELF="${0##*/}"

echo -e "${BOLD}USAGE${NF}
$SELF <remote> [-f|--force] [-m|--mount-dir <dir>] [-p|--port <port>]
[-r|--remote-dir <dir>] [-u|--unmount]
"

echo -e "${BOLD}DESCRIPTION${NF}
Mount (or unmount) a remote machine to a local directory using sshfs.
"

echo -e "${BOLD}ARGUMENTS${NF}
remote
The hostname/address of the remote machine.
"

echo -e "${BOLD}OPTIONS${NF}
"

exit 0
}

is_available() {
Expand Down Expand Up @@ -96,7 +117,9 @@ while (( "$#" )); do
esac
done

if [ $UNMOUNT ]; then
if [ -z "$REMOTE" ]; then
usage
elif [ $UNMOUNT ]; then
unmount_remote "$REMOTE"
else
mount_remote "$REMOTE"
Expand Down

0 comments on commit 5f517ad

Please sign in to comment.