-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup-kojiadminuser
executable file
·39 lines (32 loc) · 1.04 KB
/
setup-kojiadminuser
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
#!/bin/sh
echo "==========================="
echo "=== setup-kojiadminuser ==="
echo "==========================="
# The Fedora docs say to make these accounts without passwords but I think
# thats a terrible idea. For script purposes the passwords are defined here
# but can be reset to something a bit more secure afterwards
. `pwd`/defaults
# Check that all the externally defined variables we use in this script are initailized
echo -n "Checking the defaults of the following: "
for i in KOJIADMINUSER; do
if [ \$$i ]; then
echo -n "$i "
eval n=\$$i
if [ ! $n ]; then
echo
echo "conf error: $i is NOT defined/set in the defaults file. exiting."
exit 1
fi
fi
done
echo " (OK)"
TOPDIR=$TOP/koji
# ========================================================================
# No way around it, we gotta be root to do all this stuff
# ------------------------------------------------------------------------
#
for user in ${KOJIADMINUSER}
do
echo "Adding granting admin permission for $user to koji"
koji grant-permission admin $user
done