forked from n0bel/PiClock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
switcher.sh
20 lines (20 loc) · 666 Bytes
/
switcher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cd $HOME/PiClock
pkill -INT -f PyQtPiClock.py
cd Clock
if [ "$DISPLAY" = "" ]
then
export DISPLAY=:0
fi
# the main app
# create a new log file name, max of 7 log files
echo "Rotating log files...."
rm PyQtPiClock.7.log >/dev/null 2>&1
mv PyQtPiClock.6.log PyQtPiClock.7.log >/dev/null 2>&1
mv PyQtPiClock.5.log PyQtPiClock.6.log >/dev/null 2>&1
mv PyQtPiClock.4.log PyQtPiClock.5.log >/dev/null 2>&1
mv PyQtPiClock.3.log PyQtPiClock.4.log >/dev/null 2>&1
mv PyQtPiClock.2.log PyQtPiClock.3.log >/dev/null 2>&1
mv PyQtPiClock.1.log PyQtPiClock.2.log >/dev/null 2>&1
# start the clock
echo "Starting PiClock...."
python -u PyQtPiClock.py $1 >PyQtPiClock.1.log 2>&1 &