CC-3374: Ability to use eclipse to run/debug our python services. Script to prepare environment and make this possible.

-done
This commit is contained in:
Martin Konecny 2012-02-29 20:51:46 -05:00
parent b37a58aea4
commit 08048cd403

39
dev_tools/toggle-pypo-debug.sh Executable file
View file

@ -0,0 +1,39 @@
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root." 1>&2
exit 1
fi
usage () {
echo "Use --enable <user> or --disable flag. Enable is to set up environment"
echo "for specified user. --disable is to reset it back to pypo user"
}
if [ "$1" = "--enable" ]; then
/etc/init.d/airtime-playout stop
/etc/init.d/airtime-playout start-liquidsoap
user=$2
echo "Changing ownership to user $1"
chown -Rv $user:$user /var/log/airtime/pypo
chown -v $user:$user /etc/airtime/pypo.cfg
chown -Rv $user:$user /var/tmp/airtime/pypo/
chmod -v a+r /etc/airtime/api_client.cfg
elif [ "$1" = "--disable" ]; then
user="pypo"
echo "Changing ownership to user $1"
chown -Rv $user:$user /var/log/airtime/pypo
chown -v $user:$user /etc/airtime/pypo.cfg
chown -Rv $user:$user /var/tmp/airtime/pypo/
chmod -v a+r /etc/airtime/api_client.cfg
/etc/init.d/airtime-playout stop-liquidsoap
/etc/init.d/airtime-playout start
else
usage
fi