summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rw-r--r--functions27
1 files changed, 9 insertions, 18 deletions
diff --git a/functions b/functions
index 4201145..8ecd968 100644
--- a/functions
+++ b/functions
@@ -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/"
}
-