Commit b6db3e61 authored by Carlos Remuzzi's avatar Carlos Remuzzi
Browse files

detectando nmcli desde el cliente

parent 17170631
#!/usr/bin/env bash #!/usr/bin/env bash
AP_NAME=libreCast-s1
SCREEN_WIDTH=1920
SCREEN_HEIGHT=1080
if [ -z `pidof gst-launch-1.0` ];then if [ -z `pidof gst-launch-1.0` ];then
pkill -15 gst-launch-1.0 pkill -15 gst-launch-1.0
nmcli con up libreCast-s1
if [ $? -eq 0 ];then
echo "nmcli ok"
else
exit 1
fi
# se deberia testear este script if which nmcli >/dev/null 2>&1; then
pacmd unload-module module-null-sink nmcli con up $AP_NAME
pacmd load-module module-null-sink sink_name=Pantalla if [ $? -eq 1 ];then
pacmd update-sink-proplist Pantalla device.description=Pantalla exit 1
fi
fi
# a transmission is not running yet from this machine # a transmission is not running yet from this machine
curl --connect-timeout 3 -s -k -X GET https://192.168.12.1:5443/player/start | grep 'Player iniciado' curl --connect-timeout 3 -s -k -X GET https://192.168.12.1:5443/player/start | grep 'Player iniciado'
if [ $? -eq 0 ];then if [ $? -eq 0 ];then
gst-launch-1.0 ximagesrc use-damage=false ! videoconvert ! videoscale ! video/x-raw,format=I420,width=1920,height=1080,framerate=24/1,bitrate=6000 ! jpegenc quality=80 ! rtpjpegpay ! udpsink host=192.168.12.1 port=1234 sync=false &
pacmd unload-module module-null-sink
pacmd load-module module-null-sink sink_name=libreCast
pacmd update-sink-proplist Pantalla device.description=libreCast
gst-launch-1.0 ximagesrc use-damage=false ! videoconvert ! videoscale ! video/x-raw,format=I420,width=$SCREEN_WIDTH,height=$SCREEN_HEIGHT,framerate=24/1,bitrate=6000 ! jpegenc quality=80 ! rtpjpegpay ! udpsink host=192.168.12.1 port=1234 sync=false &
gst-launch-1.0 -v pulsesrc device="Pantalla.monitor" ! "audio/x-raw,rate=11500,channels=2,depth=16" ! udpsink host=192.168.12.1 port=5678 sync=false & gst-launch-1.0 -v pulsesrc device="Pantalla.monitor" ! "audio/x-raw,rate=11500,channels=2,depth=16" ! udpsink host=192.168.12.1 port=5678 sync=false &
exit 0 exit 0
else else
...@@ -31,8 +37,11 @@ else ...@@ -31,8 +37,11 @@ else
# a transmission is already running from this machine # a transmission is already running from this machine
curl --connect-timeout 3 -s -k -X GET https://192.168.12.1:5443/player/stop curl --connect-timeout 3 -s -k -X GET https://192.168.12.1:5443/player/stop
pkill -15 gst-launch-1.0 pkill -15 gst-launch-1.0
nmcli con down libreCast-s1
pacmd unload-module module-null-sink pacmd unload-module module-null-sink
if which nmcli >/dev/null 2>&1; then
nmcli con down $AP_NAME
fi
fi fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment