From 01542bf2edadb01fcec2ea978db8bbdab50f0349 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 5 Jun 2021 19:46:24 +0200 Subject: [PATCH] yWeb: align mount command Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/732f9cfadcdbb07d7247af7f4c54d05d449f1707 Author: vanhofen Date: 2021-06-05 (Sat, 05 Jun 2021) Origin message was: ------------------ - yWeb: align mount command --- data/y-web/scripts/Y_Tools.sh | 47 ++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/data/y-web/scripts/Y_Tools.sh b/data/y-web/scripts/Y_Tools.sh index 0028725a8..99cf6e65a 100644 --- a/data/y-web/scripts/Y_Tools.sh +++ b/data/y-web/scripts/Y_Tools.sh @@ -227,40 +227,53 @@ do_mount() fi # default options - if [ "$options1" = "" ] + if [ "$options1" = "" -a "$options2" = "" ] then - if [ "$options2" = "" ] + if [ "$fstype" = "0" ] # nfs then - if [ "$fstype" = "0" ] - then - options1="soft" - options2="nolock" - fi - if [ "$fstype" = "1" ] - then - options1="ro" - fi + options1="soft" + options2="nolock" + elif [ "$fstype" = "1" ] # cifs + then + options1="ro" + options2="" + elif [ "$fstype" = "2" ] # lufs + then + options1="" + options2="" fi fi + # build mount command case "$fstype" in - 0) #nfs - cmd="mount -t nfs $ip:$dir $local_dir -o $options1" + 0) # nfs + cmd="mount -t nfs $ip:$dir $local_dir" ;; - 1) - cmd="mount -t cifs $ip/$dir $local_dir -o username=$username,password=$password,unc=//$ip/$dir,$options1"; + 1) # cifs + cmd="mount -t cifs //$ip/$dir $local_dir -o username=$username,password=$password"; ;; - 2) - cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir,$options1"; + 2) # lufs + cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir"; ;; default) echo "mount type not supported" esac + if [ "$options1" != "" ] + then + if [ "$fstype" = "0" ] # nfs + then + cmd="$cmd -o $options1" + else + cmd="$cmd,$options1" + fi + fi + if [ "$options2" != "" ] then cmd="$cmd,$options2" fi + res=`$cmd` echo "$cmd" >/tmp/mount.log echo "$res" >>/tmp/mount.log