diff options
author | Colin Guthrie <colin@mageia.org> | 2014-07-28 22:12:19 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-07-28 22:12:19 +0100 |
commit | 970918c53f74801902f2b29a78d738489d783016 (patch) | |
tree | aded3495da1adc0d3d0af2ff12a0ae1ecd964f57 | |
parent | febcebab2903f03fe41cdcf50900defdb874d7a5 (diff) | |
download | mgatools-970918c53f74801902f2b29a78d738489d783016.tar mgatools-970918c53f74801902f2b29a78d738489d783016.tar.gz mgatools-970918c53f74801902f2b29a78d738489d783016.tar.bz2 mgatools-970918c53f74801902f2b29a78d738489d783016.tar.xz mgatools-970918c53f74801902f2b29a78d738489d783016.zip |
function: Fix shell script style
-rw-r--r-- | functions | 27 |
1 files changed, 9 insertions, 18 deletions
@@ -1,15 +1,12 @@ -#!/bin/sh +# to be sourced . /etc/mgatools.conf function isingroup() { grp="$1" - for group in `groups` - do if [ "$grp" = "$group" ] - then - return 0 - fi + for group in `groups`; do + [ "$grp" = "$group" ] && return 0 done return 1 } @@ -18,12 +15,8 @@ function inlist() { k="$1" list="$2" - for e in $list - do - if [ a"$k" = a"$e" ] - then - return 0 - fi + for e in $list; do + [ "$k" = "$e" ] && return 0 done return 1 } @@ -39,11 +32,10 @@ function update_hdlist() function update_common_MD5SUM() { distrorelease="$1" - for arch in $arches - do - pushd "$distribdir/$distrorelease/$arch/media/media_info" - /usr/bin/md5sum hdlist_* synthesis.* > MD5SUM - popd + for arch in $arches; do + pushd "$distribdir/$distrorelease/$arch/media/media_info" + /usr/bin/md5sum hdlist_* synthesis.* > MD5SUM + popd done } @@ -52,4 +44,3 @@ function mirror_repository() distrorelease="$1" /usr/bin/rsync $mirror_rsync_options "$distribdir/$distrorelease/" "$finaldistribdir/$distrorelease/" } - |