-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlion-mount.sh
executable file
·90 lines (77 loc) · 2.07 KB
/
lion-mount.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! /bin/bash
#
# lionfs, The Link Over Network File System
# Copyright (C) 2016 Ricardo Biehl Pasquali <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
script_name="$0"
lion_binary="./lionfs"
if [ ! -f $lion_binary -a -x $lion_binary ]; then
echo "No $lion_binary executable binary found!"
exit 1
fi
function print_usage {
echo "usage: $script_name [OPTIONS] <mount_point>"
exit 1
}
function print_help {
echo "$script_name -- Mount util for lionfs"
echo
echo " usage: $script_name [OPTIONS] <mount_point>"
echo
echo " --help|-h Show this help."
echo " --fuse-version Print fuse version."
echo " --fuse-help Print fuse help."
echo " --debug|-d Active debug mode."
echo
echo "License: GNU/GPL (See COPYING); Author: Ricardo Biehl Pasquali"
exit 0
}
unset opt_arg
while [ 0 ]; do
case "$1" in
"--help"|"-h")
print_help
;;
"--fuse-version")
exec ./lionfs -V
;;
"--fuse-help")
exec ./lionfs -h
;;
"-d"|"--debug")
opt_arg="$opt_arg -d"
;;
*)
break
;;
esac
shift
done
if [ -z "$1" ]; then
echo "No mount_point!"
print_usage
fi
if [ ! -d "$1" ]; then
echo "\"$1\" is not a directory!"
print_usage
fi
mount_point="$1"
# Options used by default:
# `-s` = single-thread operation. (deprecated)
# `-o fsname` = Name of filesystem.
# `-o use_ino` = Allow filesystem set its own inode numbers.
default_opt="-o fsname=lionfs -o use_ino"
./lionfs $mount_point $opt_arg $default_opt