forked from openbroadcaster/obplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobplayer_check
executable file
·35 lines (29 loc) · 1.06 KB
/
obplayer_check
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
#!/bin/bash
running_check=`ps -aef | grep "python? [o]bplayer.py" | wc -l`
if [ "$running_check" -ge "1" ]
then
echo OpenBroadcaster Player already running.
exit;
fi
# restart PipeWire if it's running (temporary bug fix)
# if systemctl --user is-active --quiet pipewire; then
# echo "PipeWire is running. Restarting it now (temporary bug fix)."
# systemctl --user restart pipewire
# else
# echo "PipeWire is not running."
# fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
if [ ! -x "/usr/bin/python3" ] || ! python3 -c "import apsw"
then
#echo "Switching to legacy OpenBroadcaster Player"
#git checkout legacy
#if [ $? -ne 0 ]; then
# echo ""
# echo "ERROR: failed to switch to the legacy branch. Python2 is no longer supported. Please install the Python3 dependencies listed in dependencies.txt of the source file and retry, or check out the \"legacy\" branch from the git repository to continue using Python2"
# echo ""
python2 obplayer.py $@
#fi
else
python3 obplayer.py $@
fi