summaryrefslogtreecommitdiff
path: root/net/glusterfs/files/patch-mount_glusterfs.in
blob: 45955c8c497350937fe0ce827b12f8f518393208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- xlators/mount/fuse/utils/mount_glusterfs.in.orig	2017-06-27 22:25:12.392137135 +0700
+++ xlators/mount/fuse/utils/mount_glusterfs.in	2017-12-19 18:24:21.736142000 +0700
@@ -463,50 +463,44 @@ parse_options()
         if [ "$key" = "$value" ]; then
             without_options $pair;
         else
             with_options $key $value;
         fi
     done
 }
 
 main ()
 {
-    ## `mount` on OSX specifies options as first argument
-    echo $1|grep -q -- "-o"
-    if [ $? -eq 0 ];  then
-        volfile_loc=$3
-        mount_point=$4
-    else
-        volfile_loc=$1
-        mount_point=$2
-    fi
-
     while getopts "Vo:h" opt; do
         case "${opt}" in
             o)
                 parse_options ${OPTARG};
                 ;;
             V)
                 ${cmd_line} -V;
                 exit 0;
                 ;;
             h)
                 print_usage;
                 exit 0;
                 ;;
             ?)
                 print_usage;
                 exit 0;
                 ;;
         esac
     done
 
+    shift $((OPTIND - 1))
+    volfile_loc="$1"
+    mount_point="$2"
+
     [ -r "$volfile_loc" ] || {
         # '%' included to support ipv6 link local addresses
         server_ip=$(echo "$volfile_loc" | sed -n 's/\([a-zA-Z0-9:%.\-]*\):.*/\1/p');
         volume_str=$(echo "$volfile_loc" | sed -n 's/.*:\([^ ]*\).*/\1/p');
         [ -n "$volume_str" ] && {
             volume_id="$volume_str";
         }
         volfile_loc="";
     }