-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdistcc-install-master.sh
More file actions
30 lines (29 loc) · 950 Bytes
/
distcc-install-master.sh
File metadata and controls
30 lines (29 loc) · 950 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
#!/bin/bash
#........................
[[ $1 ]] && clientip=$1 || clientip=$( cat clientip ) || clientip=$( dialog.ip 'Client IP' )
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/' )
bar "distccd-master $arch
$status
"