Skip to content

Instantly share code, notes, and snippets.

@oliver-batchelor
Last active March 25, 2020 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliver-batchelor/fa19647cc0bad2b1d3a17b9567acdce0 to your computer and use it in GitHub Desktop.
Save oliver-batchelor/fa19647cc0bad2b1d3a17b9567acdce0 to your computer and use it in GitHub Desktop.
#!/bin/bash
#!/bin/bash
read -r -d '' script <<-'EOF'
/netfs/share/bin/mountp
ln -sf ~/.p_drive/file.canterbury.ac.nz/Student/Class/cosc ./cosc_shared
EOF
ssh cosc "$script" > /dev/null 2>&1
mp="~/cosc_home"
if [ ! -z "$mp" ] ; then
mkdir -p $mp
fi
if ! [ -x "$(command -v sshfs)" ]; then
echo 'Please install sshfs (e.g. sudo apt-get install sshfs.'
exit 1
else
if df -t sshfs | grep -q $mp; then
fusermount -u $mp
fi
sshfs cosc: $mp
echo "COSC Home directory mounted on $mp"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment