forked from weaveworks/scope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·44 lines (39 loc) · 1017 Bytes
/
entrypoint.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
44
#!/bin/sh
usage() {
echo "$0 --dns <IP> --hostname <NAME> --searchpath <SEARCHPATH>"
exit 1
}
# This script exists to modify the network settings in the scope containers
# as docker doesn't allow it when started with --net=host
while true; do
case "$1" in
--dns)
[ $# -gt 1 ] || usage
DNS_SERVER="$2"
shift 2
;;
--hostname)
[ $# -gt 1 ] || usage
HOSTNAME="$2"
shift 2
;;
--searchpath)
[ $# -gt 1 ] || usage
SEARCHPATH="$2"
shift 2
;;
*)
break
;;
esac
done
if [ -n "$DNS_SERVER" -a -n "$SEARCHPATH" ]; then
echo "domain $SEARCHPATH" >/etc/resolv.conf
echo "search $SEARCHPATH" >>/etc/resolv.conf
echo "nameserver $DNS_SERVER" >>/etc/resolv.conf
fi
if [ -n "$HOSTNAME" ]; then
echo "$HOSTNAME" >/etc/hostname
hostname -F /etc/hostname
fi
/usr/bin/supervisord -c /etc/supervisord.conf