LinuxSetup/setupdrives.sh

16 lines
491 B
Bash
Raw Normal View History

2024-08-26 20:16:55 +00:00
# Array of lines to add to /etc/fstab
fstab_entries=(
"LABEL=storage /mnt/storage auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=storage 0 0"
)
# Iterate over the array and add each entry to /etc/fstab if it doesn't already exist
for entry in "${fstab_entries[@]}"; do
if ! grep -qF "$entry" /etc/fstab; then
echo "$entry" | sudo tee -a /etc/fstab > /dev/null
echo "Added entry: $entry"
else
echo "Entry already exists: $entry"
fi
done
sudo reboot