Last active
March 25, 2020 22:45
-
-
Save oliver-batchelor/fa19647cc0bad2b1d3a17b9567acdce0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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