-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart
More file actions
executable file
·32 lines (26 loc) · 721 Bytes
/
start
File metadata and controls
executable file
·32 lines (26 loc) · 721 Bytes
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
#!/bin/bash
set -e
# generate a password for root.
#ROOT_PASSWORD=$(pwgen -c -n -1 12)
#echo "root:$ROOT_PASSWORD" | chpasswd
#echo User: root Password: $ROOT_PASSWORD
chmod 775 /data
# create directory for bind config
mkdir -p /data/bind
chown -R root:bind /data/bind
# populate default bind configuration if it does not exist
if [ ! -d /data/bind/etc ]; then
mv /etc/bind /data/bind/etc
fi
rm -rf /etc/bind
ln -sf /data/bind/etc /etc/bind
if [ ! -d /data/bind/lib ]; then
mkdir -p /data/bind/lib
chown root:bind /data/bind/lib
fi
rm -rf /var/lib/bind
ln -sf /data/bind/lib /var/lib/bind
echo "Starting named..."
mkdir -m 0775 -p /var/run/named
chown root:bind /var/run/named
exec /usr/sbin/named -u bind -g