Circlean/fs/opt/groomer/init.sh

44 lines
931 B
Bash
Raw Normal View History

2013-02-15 18:47:13 +01:00
#!/bin/bash
set -e
2015-05-26 19:06:02 +02:00
set -x
2013-02-15 18:47:13 +01:00
source ./constraint.sh
if [ ${ID} -ne 0 ]; then
echo "This script has to be run as root."
exit
fi
clean(){
echo Done, cleaning.
${SYNC}
kill -9 $(cat /tmp/music.pid)
rm -f /tmp/music.pid
}
trap clean EXIT TERM INT
./music.sh &
echo $! > /tmp/music.pid
# Dumb libreoffice wants to write into ~/libreoffice or crash with
# com::sun::star::uno::RuntimeException
mkdir /tmp/libreoffice
chown -R kitten:kitten /tmp/libreoffice
# Avoid:
# Failed to connect to /usr/lib/libreoffice/program/soffice.bin (pid=2455) in 6 seconds.
# Connector : couldn't connect to socket (Success)
# Error: Unable to connect or start own listener. Aborting.
mkdir /tmp/libreoffice_config
chown -R kitten:kitten /tmp/libreoffice_config
2016-07-05 16:15:00 +02:00
# Reject all network connexions.
iptables -F
iptables -A INPUT -j REJECT
iptables -A OUTPUT -j REJECT
iptables -A FORWARD -j REJECT
2013-06-06 16:26:23 +02:00
su ${USERNAME} -c ./groomer.sh
2013-02-15 18:47:13 +01:00