Welcome to kriss.run!


Back

mount_nas3.sh

#!/usr/bin/env bash

if grep -q 'NAS3' /etc/fstab; then
    echo "NAS3 is already in /etc/fstab"
    return
fi

echo "Installing requirements..."
apt install nfs-common

echo "Creating local mountpoint (/NAS3/Share)..."
mkdir -p /NAS3/Share

echo "Adding to /etc/fstab..."
echo "10.0.1.31:/volume1/Share  /NAS3/Share/    nfs    rw,vers=4,hard,timeo=600,nolock   0 0" >> /etc/fstab

echo "Reloading system daemon..."
systemctl daemon-reload

echo "Mounting..."
mount -a

echo "Done!"