Skip to content

Instantly share code, notes, and snippets.

@Coro365

Coro365/mount_nas.sh

Last active Oct 23, 2017
Embed
What would you like to do?
#!/bin/sh
mount(){
USER="NAS_USER_NAME"
ADDRESS="readynas104.local"
PASSWD="PASSWD"
for server_path in $@
do
mount_path=/Volumes/${server_path}
mkdir ${mount_path}
printf "mounting: ${mount_path}...\t"
mount_smbfs //${USER}:${PASSWD}@${ADDRESS}/${server_path} ${mount_path}
if [ ! $? -gt 0 ]; then
echo "[ O K ]"
else
rm -rf ${mount_path}
fi
done
}
mount NAS_PATH1 NAS_PATH2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.