-
Notifications
You must be signed in to change notification settings - Fork 0
/
dhcpcd.sh
executable file
·48 lines (41 loc) · 1.03 KB
/
dhcpcd.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
45
46
47
48
# See LICENSE for license details.
#!/bin/bash
set -euo pipefail
unpack_src() {
tar xf dhcpcd-9.4.0.tar.xz
cd dhcpcd-9.4.0
return
}
setup_users() {
# TODO: can't cleanly be uninstalled
install -v -m700 -d /var/lib/dhcpcd &&
groupadd -g 52 dhcpcd &&
useradd -c 'dhcpcd PrivSep' \
-d /var/lib/dhcpcd \
-g dhcpcd \
-s /bin/false \
-u 52 dhcpcd &&
chown -v dhcpcd:dhcpcd /var/lib/dhcpcd
}
configure() {
./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/lib/dhcpcd \
--dbdir=/var/lib/dhcpcd \
--privsepuser=dhcpcd
}
make_install() {
make
make DESTDIR=$TODD_FAKE_ROOT_DIR -j1 install
return
}
post_install() {
ONBOOT="yes"
cat > /etc/sysconfig/ifconfig.enp0s3 << "EOF"
IFACE="enp0s3"
SERVICE="dhcpcd"
DHCP_START="-b -q"
DHCP_STOP="-k"
EOF
}
unpack_src && setup_users && configure && make_install && post_install