Last active
July 24, 2020 20:50
-
-
Save Marc-Bender/caf9d9976a14ca1741fb595482d3426e to your computer and use it in GitHub Desktop.
Mounting script for nfs mounting various shares on my NAS
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 | |
address=$(sudo arp-scan -I enp5s0 -localnet | grep "Synology" | awk '{print $1'}) | |
choice=$(echo -e "Filme\nMusik\nUnsortierte Musik" | dmenu -i -p "Which NAS share to mount?") | |
if [ "$choice" == "Filme" ]; then | |
volume=2 | |
else | |
volume=1 | |
fi | |
if [ $(df 2> /dev/null | grep --count "$choice") -ne 0 ]; then | |
sudo umount "/mnt/nas/$choice" | |
else | |
sudo mount -t nfs --source $address:/volume$volume/"$choice" --targ et /mnt/nas/"$choice" --rw | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment