Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
218533e3
Commit
218533e3
authored
Nov 24, 2019
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate get ftproot and gvolume
parent
56f434f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
18 deletions
+52
-18
grf
gluster/grf
+52
-18
No files found.
gluster/grf
View file @
218533e3
...
...
@@ -13,8 +13,56 @@ fatal()
exit
1
}
get_ftproot
()
{
local
FTPROOT
local
sfile
=
"
$1
"
# hack
case
"
$sfile
"
in
/var/ftp/pvt/
*
)
FTPROOT
=
/var/ftp/pvt
;;
/var/ftp/pub/
*
)
FTPROOT
=
/var/ftp/pub
;;
/var/ftp/tmp/
*
)
FTPROOT
=
/var/ftp/tmp
;;
*
)
fatal
"Unknown place
$sfile
"
esac
echo
"
$FTPROOT
"
}
get_volume
()
{
local
GVOLUME
local
sfile
=
"
$1
"
# hack
case
"
$sfile
"
in
/var/ftp/pvt/
*
)
GVOLUME
=
ftp-pvt
;;
/var/ftp/pub/
*
)
GVOLUME
=
ftp-pub
;;
/var/ftp/tmp/
*
)
GVOLUME
=
ftp-tmp
;;
*
)
fatal
"Unknown place
$sfile
"
esac
echo
"
$GVOLUME
"
}
get_bricks
()
{
local
GVOLUME
=
"
$1
"
gluster volume info
$GVOLUME
|
grep
Brick
"[0-9]"
|
sed
-e
"s|Brick[0-9]: ||g"
|
sed
-e
"s|.(.*||g"
|
grep
-v
"arbiter"
}
...
...
@@ -128,25 +176,11 @@ if [ "$1" = "--list" ] ; then
fi
# hack
case
"
$sfile
"
in
/var/ftp/pvt/
*
)
FTPROOT
=
/var/ftp/pvt
GVOLUME
=
ftp-pvt
;;
/var/ftp/pub/
*
)
FTPROOT
=
/var/ftp/pub
GVOLUME
=
ftp-pub
;;
/var/ftp/tmp/
*
)
FTPROOT
=
/var/ftp/tmp
GVOLUME
=
ftp-tmp
;;
*
)
fatal
"Unknown place
$sfile
"
esac
;
FTPROOT
=
$(
get_ftproot
$sfile
)
GVOLUME
=
$(
get_volume
$sfile
)
LISTBRICKS
=
"
$(
get_bricks
)
"
LISTBRICKS
=
"
$(
get_bricks
$GVOLUME
)
"
[
-n
"
$LISTBRICKS
"
]
||
fatal
"empty LISTBRICKS"
MOUNTDIR
=
~/grf-mount
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment