2015-11-06 17:40:33 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
source ./constraint.sh
|
|
|
|
|
|
|
|
if [ ${ID} -ne 0 ]; then
|
2017-01-11 04:03:33 +01:00
|
|
|
echo "GROOMER: This script has to be run as root."
|
2015-11-06 17:40:33 +01:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
clean(){
|
2017-01-11 04:03:33 +01:00
|
|
|
echo "GROOMER: cleaning up after init.sh."
|
2015-11-06 17:40:33 +01:00
|
|
|
${SYNC}
|
|
|
|
kill -9 $(cat /tmp/music.pid)
|
|
|
|
rm -f /tmp/music.pid
|
|
|
|
}
|
|
|
|
|
|
|
|
trap clean EXIT TERM INT
|
|
|
|
|
|
|
|
./music.sh &
|
|
|
|
echo $! > /tmp/music.pid
|
2017-01-11 04:03:33 +01:00
|
|
|
echo "GROOMER: music started."
|
2015-11-06 17:40:33 +01:00
|
|
|
|
2017-01-11 04:03:33 +01:00
|
|
|
su ${USERNAME} -c ./groomer.sh | tee ${GROOM_LOG}
|