forked from lanceseidman/PiCAST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.sh
executable file
·39 lines (33 loc) · 1.24 KB
/
server.sh
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
36
37
38
39
#!/bin/sh
############################################
# PiCAST Server/Listener
# ------------------------------------------
# Setup: chmod +x server.sh
# Start Command: sh /server.sh
############################################
########### Start PiCAST Networking ###########
# Pi IP/Port (Optional)
address="127.0.0.1"
port="8882"
########### End PiCAST Networking ###########
#echo "Reading Config File for Settings..."
pass=$(awk "NR==1 {print;exit}" con.cfg)
echo "Welcome to PiCAST!"
echo "------------------"
theIP=`/sbin/ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
if [ $theIP != null ]; then
echo "To CAST, please send requests to IP: " $theIP
echo "+===================================================+"
echo "Example: pic_ytvideo <URL/VIDEO> | cryptcat $theIP $port -k <pass>"
else
theIP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
echo "To CAST, please send requests to IP: " $theIP
echo "+===================================================+"
echo "Example: pic_ytvideo <URL/VIDEO> | cryptcat $theIP $port -k <pass>"
fi
# Let's start the process of keeping me ALIVE!
while true
do
# We're going to use the pre-defined settings above, change as needed.
cryptcat -l -p $port -k $pass
done