-
Notifications
You must be signed in to change notification settings - Fork 0
/
distcc-install-master.sh
47 lines (36 loc) · 1.14 KB
/
distcc-install-master.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
#!/bin/bash
optbox=( --colors --no-shadow --no-collapse )
dialog "${optbox[@]}" --infobox "
Install \Z1Distcc\Z0 Master
" 9 58
sleep 1
[[ $1 ]] && clientip=$1 || clientip=$( cat clientip ) || clientip=$( dialog "${optbox[@]}" --output-fd 1 --nocancel --inputbox "
Client IP:
" 0 0 192.168.1.9 )
pacman -Sy --noconfirm distcc
# MAKEFLAGS="-j12" --- 2x max threads per client
# BUILDENV=(distcc color !ccache check !sign) --- unnegate !distcc
# DISTCC_HOSTS="192.168.1.9:3636/8 192.168.1.4/4" --- CLIENT_IP:PORT/JOBS (JOBS: 2x max threads per client)
# Single core CPU - Omit Master IP from DISTCC_HOSTS
jobs=12
if [[ -e /boot/kernel8.img ]]; then
port=3636
arch=armv8/aarch64
elif [[ -e /boot/kernel7.img ]]; then
port=3635
arch=armv7h
else
port=3634
arch=armv6h
jobs=8
fi
sed -i -e 's/^#*\(MAKEFLAGS="-j\).*/\1'$jobs'"/
' -e 's/!distcc/distcc/
' -e "s|^#*\(DISTCC_HOSTS=\"\).*|\1$clientip:$port/$jobs\"|
" /etc/makepkg.conf
systemctl start distccd
status=$( systemctl status distccd | sed 's/active (running)/\\e[32m&\\e[0m/' )
clear -x
echo -e "\
\e[32mdistccd-master $arch\e[0m
$status"