From e5ce6431438a1f4a2fb3aa6b1bf5cabd87b954c1 Mon Sep 17 00:00:00 2001 From: wagesj45 Date: Thu, 31 Jul 2025 03:03:50 -0500 Subject: [PATCH] cifs -> nfs --- setup.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index 74f63a6..887fdf8 100644 --- a/setup.sh +++ b/setup.sh @@ -157,28 +157,30 @@ echo 'neofetch' >/etc/profile.d/90-neofetch.sh chmod +x /etc/profile.d/90-neofetch.sh ############################################################################### -# CIFS mounts # +# NFS mounts # ############################################################################### -CIFS_HOSTS=(jimmu keiko keitai) -OPTS=(); for h in "${CIFS_HOSTS[@]}"; do OPTS+=("$h" "" OFF); done -SEL_HOSTS=$(whiptail --title "CIFS Mounts" --checklist \ +NFS_HOSTS=(jimmu keiko keitai) +OPTS=(); for h in "${NFS_HOSTS[@]}"; do OPTS+=("$h" "" OFF); done +SEL_HOSTS=$(whiptail --title "NFS Mounts" --checklist \ "Select NAS shares to mount under /media:" 15 60 6 \ "${OPTS[@]}" 3>&1 1>&2 2>&3) || true + mkdir -p /media -for host in "${CIFS_HOSTS[@]}"; do - TEMPLATE="//${host}.wageshouse/Data /media/${host} cifs username=%s,password=%s,_netdev,vers=2.0 0 0" +for host in "${NFS_HOSTS[@]}"; do + TEMPLATE="${host}.wageshouse:/Data /media/${host} nfs4 _netdev,x-systemd.automount,noatime 0 0" if [[ $SEL_HOSTS == *\"$host\"* ]]; then - U=$(whiptail --inputbox "[$host] CIFS username:" 8 50 3>&1 1>&2 2>&3) || exit 1 - P=$(whiptail --passwordbox "[$host] CIFS password:" 8 50 3>&1 1>&2 2>&3) || exit 1 - printf -v LINE "$TEMPLATE" "$U" "$P" mkdir -p "/media/$host" - grep -q "${host}.wageshouse" /etc/fstab && sed -i "#${host}\.wageshouse#d" /etc/fstab - echo "$LINE" >> /etc/fstab + grep -q "${host}.wageshouse" /etc/fstab && \ + sed -i "#${host}\.wageshouse#d" /etc/fstab + echo "$TEMPLATE" >> /etc/fstab else - grep -q "${host}.wageshouse" /etc/fstab || printf "# $TEMPLATE\n" "username" "password" >> /etc/fstab + grep -q "${host}.wageshouse" /etc/fstab || echo "# $TEMPLATE" >> /etc/fstab fi done -if ! mount -a 2>>"$LOGFILE"; then msg "⚠️ Some CIFS mounts failed. Re-run the script to correct credentials."; fi + +if ! mount -a 2>>"$LOGFILE"; then + msg "⚠️ Some NFS mounts failed. Re-run the script to check configuration." +fi ############################################################################### # Summary #