forked from rern/rAudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
76 lines (59 loc) · 2.24 KB
/
install.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
alias=r1
. /srv/http/bash/addons.sh
# 20221007
grep -q hard,intr /etc/fstab && sed -i '/hard,intr/soft/' /etc/fstab
[[ -e $dirsystem/hddspindown ]] && mv $dirsystem/{hddspindown,apm}
if [[ ! -e /boot/kernel.img ]]; then
dir=/etc/systemd/system
for file in $dir/spotifyd.service $dir/upmpdcli.service; do
! grep -q CPUAffinity $file && sed -i -e '/Service/ a\CPUAffinity=3' -e '/ExecStartPost/ d' -e 's|/usr/bin/taskset -c 3 ||' $file
done
for file in $dir/mpd.service.d/override.conf $dir/shairport-sync.service.d/override.conf; do
! grep -q CPUAffinity $file && sed -i -e '/Service/ a\CPUAffinity=3' -e '/ExecStart/ d' $file
done
for file in $dir/bluealsa.service.d/override.conf $dir/bluetooth.service.d/override.conf; do
! grep -q CPUAffinity $file && sed -i -e '/Service/ a\CPUAffinity=3' $file
done
fi
dir=/srv/http/assets/img/guide
if [[ ! -e $dir/1.jpg ]]; then
mkdir -p $dir
if [[ -e /srv/http/assets/img/1.jpg ]]; then
find /srv/http/assets/img -maxdepth 1 -type f -name '[0-9]*' -exec mv {} $dir \;
else
curl -skL https://github.com/rern/_assets/raw/master/guide/guide.tar.xz | bsdtar xf - -C $dir
fi
fi
file=/etc/systemd/system/dab.service
if [[ -e /usr/bin/rtl_sdr && ! -e $file ]]; then
echo "\
[Unit]
Description=DAB Radio metadata
[Service]
Type=simple
ExecStart=/srv/http/bash/status-dab.sh
" > $file
fi
systemctl daemon-reload
# 20220916
if (( $( cat $dirmpd/counts | wc -l ) == 1 )); then
echo '{
"playlists" : '$( ls -1 $dirplaylists | wc -l )'
, "webradio" : '$( find -L $dirwebradio -type f ! -path '*/img/*' | wc -l )'
}' > $dirmpd/counts
fi
# 20220907
[[ $( pacman -Q bluez ) < 'bluez 5.65-3' ]] && pacman -Sy --noconfirm bluez bluez-utils
# 20220826
rm /srv/http/bash/{camilladsp*,features*,networks*,player*,relays*,system*} &> /dev/null
#-------------------------------------------------------------------------------
installstart "$1"
getinstallzip
chmod +x /srv/http/bash/settings/system.sh
/srv/http/bash/settings/system.sh dirpermissions
[[ -e /srv/http/data/system/color ]] && /srv/http/bash/cmd.sh color
installfinish
#-------------------------------------------------------------------------------
# 20221010
[[ -e /srv/http/shareddata ]] && echo -e "$info Shared Data must be disabled and setup again."