mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
yWeb: align mount command
Origin commit data
------------------
Commit: 732f9cfadc
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-06-05 (Sat, 05 Jun 2021)
Origin message was:
------------------
- yWeb: align mount command
This commit is contained in:
@@ -227,40 +227,53 @@ do_mount()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# default options
|
# default options
|
||||||
if [ "$options1" = "" ]
|
if [ "$options1" = "" -a "$options2" = "" ]
|
||||||
then
|
then
|
||||||
if [ "$options2" = "" ]
|
if [ "$fstype" = "0" ] # nfs
|
||||||
then
|
then
|
||||||
if [ "$fstype" = "0" ]
|
options1="soft"
|
||||||
then
|
options2="nolock"
|
||||||
options1="soft"
|
elif [ "$fstype" = "1" ] # cifs
|
||||||
options2="nolock"
|
then
|
||||||
fi
|
options1="ro"
|
||||||
if [ "$fstype" = "1" ]
|
options2=""
|
||||||
then
|
elif [ "$fstype" = "2" ] # lufs
|
||||||
options1="ro"
|
then
|
||||||
fi
|
options1=""
|
||||||
|
options2=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build mount command
|
# build mount command
|
||||||
case "$fstype" in
|
case "$fstype" in
|
||||||
0) #nfs
|
0) # nfs
|
||||||
cmd="mount -t nfs $ip:$dir $local_dir -o $options1"
|
cmd="mount -t nfs $ip:$dir $local_dir"
|
||||||
;;
|
;;
|
||||||
1)
|
1) # cifs
|
||||||
cmd="mount -t cifs $ip/$dir $local_dir -o username=$username,password=$password,unc=//$ip/$dir,$options1";
|
cmd="mount -t cifs //$ip/$dir $local_dir -o username=$username,password=$password";
|
||||||
;;
|
;;
|
||||||
2)
|
2) # lufs
|
||||||
cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir,$options1";
|
cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir";
|
||||||
;;
|
;;
|
||||||
default)
|
default)
|
||||||
echo "mount type not supported"
|
echo "mount type not supported"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$options1" != "" ]
|
||||||
|
then
|
||||||
|
if [ "$fstype" = "0" ] # nfs
|
||||||
|
then
|
||||||
|
cmd="$cmd -o $options1"
|
||||||
|
else
|
||||||
|
cmd="$cmd,$options1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$options2" != "" ]
|
if [ "$options2" != "" ]
|
||||||
then
|
then
|
||||||
cmd="$cmd,$options2"
|
cmd="$cmd,$options2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
res=`$cmd`
|
res=`$cmd`
|
||||||
echo "$cmd" >/tmp/mount.log
|
echo "$cmd" >/tmp/mount.log
|
||||||
echo "$res" >>/tmp/mount.log
|
echo "$res" >>/tmp/mount.log
|
||||||
|
Reference in New Issue
Block a user