-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
43 lines (39 loc) · 912 Bytes
/
init.sh
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
40
41
42
43
#!/bin/bash
if [ -e /etc/yum.repos.d-overlay ] ; then
if [ ! -L /etc/yum.repos.d ] ; then
mv /etc/yum.repos.d /etc/yum.repos.d-save
mkdir -p /etc/yum.repos.d
cp /etc/yum.repos.d-overlay/* /etc/yum.repos.d
fi
fi
if [ -d local-repos ] ; then
for repo in /local-repos/*; do
REPONAME=$(basename $repo)
cat > /etc/yum.repos.d/local-$REPONAME.repo << EOF
[localrepo-$REPONAME]
name=Local repo $REPONAME
failovermethod=priority
enabled=1
gpgcheck=0
baseurl=file://$repo
EOF
done
fi
if [ -n "$EXTRA_REPOS" ] ; then
for repo in $EXTRA_REPOS; do
REPONAME=$(echo $repo | sed s,\",,g | cut -d "/" -f 4- | sed s,/,_,g | sed s,_$,,)
cat > /etc/yum.repos.d/$REPONAME.repo << EOF
[$REPONAME]
name=$REPONAME
failovermethod=priority
enabled=1
gpgcheck=0
baseurl=$repo
EOF
done
fi
if [ -n "$SYSTEMD" ] ; then
exec /sbin/init
else
exec /bin/bash
fi