-
Notifications
You must be signed in to change notification settings - Fork 7
/
etc_rc_local
50 lines (34 loc) · 1.4 KB
/
etc_rc_local
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
#!/bin/sh
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
export AUDIO_USER="$(getent passwd 1000|cut -d: -f1)"
fsck -y /dev/mmcblk0p5
fsck -y /dev/mmcblk0p6
mount /dev/mmcblk0p5 -o ro "/home/$AUDIO_USER/config"
mount /dev/mmcblk0p6 "/home/$AUDIO_USER/disk"
(
while ! chronyc sources|grep '^#\* PPS.*ns\]' > /dev/null ; do
sleep 1
done
chronyc makestep
export LC_ALL=C
AUDIO_NAME=$(hostname|perl -np -e 's/-/_/g')
HOSTNAME=$(hostname)
RECORDER=$(arecord -l|perl -n -e 'print $1, "\n" if /^card (\d+): Device/')
su - "$AUDIO_USER" -c "cd /home/$AUDIO_USER/disk/log && uptime > time_to_sync 2>&1"
su - "$AUDIO_USER" -c "cd /home/$AUDIO_USER/disk/log && /home/$AUDIO_USER/sbts-aru/get_location.sh > location 2>&1"
if [ ! -z "$RECORDER" ] ; then
echo Matches $RECORDER
amixer -c "$RECORDER" sset 'Mic' 27db
su - $AUDIO_USER -c "JACK_NO_AUDIO_RESERVATION=1 /usr/bin/jackd -R -dalsa -r44100 -p2048 -i1 -n2 -D -Chw:$RECORDER,0 -Phw:$RECORDER,0 -S > /dev/null 2>&1 &"
sleep 1
su - "$AUDIO_USER" -c "cd /home/$AUDIO_USER/disk/$HOSTNAME ; /home/$AUDIO_USER/sbts-bin/sbts-aru -n $AUDIO_NAME -c $AUDIO_NAME -s system:capture_1 -p input -t 10 -b 44100 > /dev/null 2>&1 &"
fi
# Turn off the power and activity leds
#echo 0 | sudo tee /sys/devices/platform/leds/leds/led0/brightness
)&
# Turn of HDMI
#/opt/vc/bin/tvservice -o
exit 0