diff options
author | Kaleb S KEITHLEY <kkeithle@redhat.com> | 2016-05-17 11:10:56 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-05-18 06:55:15 -0700 |
commit | 72c3acb4113921857c586f77d60d2f4eafc53d76 (patch) | |
tree | cedc9cdb67c0e87d22fe1d14a23bf72b21e4490c /tools | |
parent | 2321e8968eadfc34fce3a0026aafc8fa18e0bbb5 (diff) |
scripts: bash-isms in scripts
Backport of
> http://review.gluster.org/#/c/14401/
> BUG: 1336853
> Change-Id: I05f8718fb73c16dbb37c1f7460bb7b55cc0ffe97
Change-Id: I05f8718fb73c16dbb37c1f7460bb7b55cc0ffe97
BUG: 1336854
Reported-by: Patrick Matthäi <pmatthaei@debian.org>
Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Change-Id: I2ab6b4089e658f766e0c73fa7de0579b48a30c49
Reviewed-on: http://review.gluster.org/14402
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Prasanna Kumar Kalever <pkalever@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gfind_missing_files/gfid_to_path.sh | 5 | ||||
-rw-r--r-- | tools/gfind_missing_files/gfind_missing_files.sh | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/tools/gfind_missing_files/gfid_to_path.sh b/tools/gfind_missing_files/gfid_to_path.sh index 20ac6a94fd2..ebe817ac2f3 100644 --- a/tools/gfind_missing_files/gfid_to_path.sh +++ b/tools/gfind_missing_files/gfid_to_path.sh @@ -11,7 +11,7 @@ E_BADARGS=65 -function gfid_to_path() +gfid_to_path () { brick_dir=$1; gfid_file=$(readlink -e $2); @@ -29,7 +29,8 @@ function gfid_to_path() } -function main(){ +main () +{ if [ $# -ne 2 ] then echo "Usage: `basename $0` BRICK_DIR GFID_FILE"; diff --git a/tools/gfind_missing_files/gfind_missing_files.sh b/tools/gfind_missing_files/gfind_missing_files.sh index 07d6befc958..f42fe7b05af 100644 --- a/tools/gfind_missing_files/gfind_missing_files.sh +++ b/tools/gfind_missing_files/gfind_missing_files.sh @@ -14,18 +14,18 @@ SLAVEVOL= #Slave volume SLAVEMNT= #Slave gluster volume mount point WORKERS=4 #Default number of worker threads -function out() +out() { echo "$@"; } -function fatal() +fatal() { out FATAL "$@"; exit 1 } -function ping_host () +ping_host () { ### Use bash internal socket support { @@ -39,7 +39,7 @@ function ping_host () } 1>&2 2>/dev/null } -function mount_slave() +mount_slave() { local i; # inode number SSH_PORT=22 @@ -59,7 +59,7 @@ function mount_slave() [ "x$i" = "x1" ] || fatal "Could not mount volume $2 on $SLAVEMNT Please check host and volume exists"; } -function parse_cli() +parse_cli() { if [[ $# -ne 4 ]]; then echo "Usage: gfind_missing_files <brick-path> <slave-host> <slave-vol> <OUTFILE>" @@ -76,7 +76,7 @@ function parse_cli() fi } -function main() +main() { parse_cli "$@"; |