2 # This file is part of Libre-Streamer.
4 # Libre-Streamer is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # Libre-Streamer is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Libre-Streamer. If not, see <http://www.gnu.org/licenses/>.
17 # Copyright (c) 2014 Lisa Marie Maginnis
18 # Copyright (c) 2014 Nico Cesar
22 high
=`tput smso` highoff
=`tput rmso`
23 ul
=`tput smul` rul
=`tput rmul`
27 function kill_screencasts
{
32 interface
=$
(/sbin
/ifconfig
-a |
egrep 'eth[0-9] ' | cut
-f1 -d\
)
33 ipaddress
=$
(/sbin
/ifconfig
$interface |
sed -n 's/ *inet addr:\([0-9.]*\) .*/\1/p')
34 clients
=$
(ps
-ef |
grep sshd
:\ libreplanet@pts |
grep -v grep |
wc -l)
35 screentarget
=$
(xauth list |
tail -n 1 |
sed 's/.*unix:\([0-9]*\) .*/localhost:\1/')
39 if [ $clients -gt 0 ] && [ "$screentarget" != 'localhost:0.0' ] ; then
40 client_status
=CONNECTED
41 endx
='endx='$
(DISPLAY
=$screentarget xrandr |
awk '/Screen 0/{sub(",", "", $10);x=$8; y=$10;} / connected/{sub(/x.*/, "", $3);secondhead=$3} END{print x-secondhead;}')
44 client_status
=NOT\ CONNECTED
48 export screentarget endx
51 function view_camera
{
52 echo osd_show_text
'Press\ [ENTER]\ to\ quit' 100000 | \
53 mplayer
-lavdopts threads
=2 -slave -fs -zoom rtsp
://$IP &>/dev
/null
&
56 function start_stream
{
60 while [[ "$reply" != "q" ]] && [[ "$reply" != "Q" ]]; do
65 | | (_) |__ _ __ ___ / ___|| |_ _ __ ___ __ _ _ __ ___ ___ _ __
66 | | | | '_ \| '__/ _ \____\___ \| __| '__/ _ \/ _\` | '_ \` _ \ / _ \ '__|
67 | |___| | |_) | | | __/_____|__) | |_| | | __/ (_| | | | | | | __/ |
68 |_____|_|_.__/|_| \___| |____/ \__|_| \___|\__,_|_| |_| |_|\___|_|
72 IP Address: "$high$ipaddress$highoff"
75 Remote Client: "$high$client_status$highoff" Target: "$high$screentarget$highoff"
79 (R)efresh Streaming Point Info
81 (K)ill screencast clients