Files
public-setupfiles/fstab-setup/setup-fstab.sh
T

34 lines
957 B
Bash
Raw Normal View History

2024-03-31 15:27:09 -05:00
# asking for password for fstab entry
2025-02-24 18:44:15 -06:00
read -p "Enter password: " PASSWORD
2024-03-31 15:27:09 -05:00
# installed needed package
2023-12-16 19:03:50 -06:00
apt update
apt-get -y install \
samba-common-bin \
smbclient \
cifs-utils \
exfat-fuse \
curl \
unattended-upgrades \
cron-apt \
git \
curl
# Make directories
2025-04-07 16:43:18 -05:00
cd /mnt
2023-12-16 19:03:50 -06:00
mkdir nasmedia
mkdir naspublic
2024-05-07 14:48:25 -05:00
mkdir naspublic-share2
2023-12-16 19:03:50 -06:00
# Echo the command below into the file /etc/fstab
2025-03-15 18:42:40 -05:00
echo '# NAS Public Share
//nas/Public /mnt/naspublic cifs credentials=/root/.smbcredentials,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
# NAS Media Share
//nas/media /mnt/nasmedia cifs credentials=/root/.smbcredentials,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
# NAS Public2 Share
//nas/public2 /mnt/naspublic-share2 cifs credentials=/root/.smbcredentials,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0' | sudo tee -a /etc/fstab
2023-12-16 19:03:50 -06:00
2024-03-31 15:27:09 -05:00
# Mount the file systems
mount -a