File get_iplayer_pvr of Package get_iplayer (Revision fdcfc5eaa88f69decfd700e787046614)
Currently displaying revision fdcfc5eaa88f69decfd700e787046614 , Show latest
56
1
#!/bin/bash
2
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9
# OTHER DEALINGS IN THE SOFTWARE.
10
11
cd $HOME
12
13
. /etc/sysconfig/get_iplayer
14
15
xterm -geometry 72x6-0+0 -bg white -fg black -title "get_iplayer Web PVR Manager" -iconic -e /usr/share/get_iplayer/get_iplayer.cgi -p $GET_IPLAYER_PORT -l $GET_IPLAYER_ADDRESS &
16
17
# Wait to start browser until server is started
18
sleep 1s
19
iterate=0
20
while [ -z "`ps -C get_iplayer.cgi -o pid=`" ]
21
do
22
echo "Waiting for web pvr to start"
23
sleep 1s
24
((iterate = iterate + 1))
25
if [ $iterate -eq 15 ]
26
then echo "The web pvr was unable to start."
27
echo
28
exit 1
29
fi
30
done
31
32
# Start browser
33
if [ -z $BROWSER ]
34
then
35
if [ "`which opera 2>/dev/null`" ]
36
then export BROWSER=`which opera`
37
elif [ "`which firefox 2>/dev/null`" ]
38
then export BROWSER=`which firefox`
39
elif [ "`which konqueror 2>/dev/null`" ]
40
then export BROWSER=`which konqueror`
41
elif [ "`which seamonkey 2>/dev/null`" ]
42
then export BROWSER=`which seamonkey`
43
elif [ "`which mozilla 2>/dev/null`" ]
44
then export BROWSER=`which mozilla`
45
else
46
echo "I cannot seem to find an internet browser"
47
echo "Please run one and point it to:"
48
echo ""
49
echo "http://$GET_IPLAYER_ADDRESS:$GET_IPLAYER_PORT"
50
exit 1
51
fi
52
fi
53
sleep 2s
54
$BROWSER http://$GET_IPLAYER_ADDRESS:$GET_IPLAYER_PORT &
55
56