cccam miregal
#!/bin/sh
CAMNAME="CCcam Server"
# end
# CCcam Start
start_cam ()
{
timestamp=`date +"%Y%m%d_%H%M"`
if [ -f /var/log/syslog ]
then
mv /var/log/syslog /var/log/CCcam-Restart-$timestamp.log
fi
/emu/cccam/CCcam.x86 -v -t & #logged CCcam Messages in SYSLOG !
}
# CCcam Stop
stop_cam ()
{
pkill CCcam.x86
}
case "$1" in
start)
echo "$1: $CAMNAME"
start_cam
;;
stop)
echo "$1: $CAMNAME"
stop_cam
;;
restart)
echo "Restarting $CAMNAME"
stop_cam
start_cam
;;
status)
echo "$CAMNAME Info"
/emu/script/cccam-status.sh
;;
backup)
echo "$CAMNAME Backup"
/emu/script/cccam-backup.sh
;;
*)
echo "Commands: cccam {start|stop|restart} {status|backup}" >&2
exit 1
;;
esac
exit 0
#!/bin/sh
#Backup the exist CCcam.cfg
SOURCE1=/var/etc
SOURCE2=/var/keys
FILE1=CCcam.cfg
FILE2=CCcam.channelinfo
FILE3=CCcam.providers
BACKUPDIR=/var/backups
MOUNTPATH=/mnt/backup
SHARE=//winsrv/sicherungen/CCcam
USER=vdr
PASS=linux
TIMESTAMP=`date +"%Y%m%d_%H%M"`
if test -f $SOURCE1/$FILE1 ; then
echo " Local Backup"
if test -d $BACKUPDIR ; then
cp $SOURCE1/$FILE1 $BACKUPDIR/$FILE1-$TIMESTAMP
cp $SOURCE2/$FILE2 $BACKUPDIR/$FILE2-$TIMESTAMP
cp $SOURCE2/$FILE3 $BACKUPDIR/$FILE3-$TIMESTAMP
echo " Backup has created in -> $BACKUPDIR/$FILE1-$TIMESTAMP"
echo " Backup has created in -> $BACKUPDIR/$FILE2-$TIMESTAMP"
echo " Backup has created in -> $BACKUPDIR/$FILE3-$TIMESTAMP"
echo ""
echo " Remote Backup (Windows Share)"
# Mount des Windowsshare
mount -t smbfs -o username=$USER,password=$PASS, $SHARE $MOUNTPATH
# Kopiere Dateien auf Backupserver
cp $SOURCE1/$FILE1 $MOUNTPATH/$FILE1-$TIMESTAMP
cp $SOURCE2/$FILE2 $MOUNTPATH/$FILE2-$TIMESTAMP
cp $SOURCE2/$FILE3 $MOUNTPATH/$FILE3-$TIMESTAMP
echo " Backup has created in -> $SHARE/$FILE1-$TIMESTAMP"
echo " Backup has created in -> $SHARE/$FILE2-$TIMESTAMP"
echo " Backup has created in -> $SHARE/$FILE3-$TIMESTAMP"
# UMount
umount $MOUNTPATH
else
echo " Backup directory does not exist, Create this !"
fi
else
echo " $FILE1 not exist in $SOURCE1, is this Path ok ?"
fi
echo "Finish"
exit
#!/bin/sh
# set -x
WEBUSER="cccam"
WEBPASS="password"
URL=192.168.178.1
PORT="16001"
tmpfile="/tmp/cccam.001"
tmpfile2="/tmp/cccam.002"
PID="$(pgrep -x CCcam.x86)"
PID2="$(pidof CCcam.x86)"
PID3="$(pidof CCcam.x86 | wc -w)"
DVB_CARDS=$(ls -l /dev/dvb 2>/dev/null | grep adapter | wc -l)
WUP=""
[ "$WEBUSER" != "" ] && WUP="$WEBUSER:$WEBPASS@"
rm -f /tmp/cccam.0*
if [[ ! -z $PID ]] ; then
echo "" >> $tmpfile
echo "$(date)" >> $tmpfile
echo "" >> $tmpfile
wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | grep "Welcome" | sed 's/^.*\(Welcome to CCcam [0-9.]* server\).*$/\1/' >> $tmpfile
echo "" >> $tmpfile
echo "DVB Cards: $DVB_CARDS" >> $tmpfile
echo "Running CCcams: ${PID3}" >> $tmpfile
echo "Process ID: ${PID2}" >> $tmpfile
else
echo "CCcam ist nicht gestartet"
exit
fi
wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | while
true
do
read line
upTime=${line#*Uptime:*}
echo "Uptime:"$upTime >> $tmpfile
break
done
echo "" >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
echo "Shareinfo:" >> $tmpfile
echo "" >> $tmpfile
wget -q -O - "[URL]http://$WUP$URL:$PORT/shares[/URL]" | while
true
do
read line
read line
echo $line >> $tmpfile
break
done
echo "" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep CCcam-s2s | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2 >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep newcamd | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2 >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep camd3 | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2 >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep radegast | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2 >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep gbox | cut -f 2,7 -d "|" > $tmpfile2
sed -e 's/|/ Cards: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
echo "Serverinfo:" >> $tmpfile
echo "" >> $tmpfile
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c CCcam-s2s) -ne 0 ] ; then
echo "CCcam-s2s:" >> $tmpfile
echo "-----------" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep CCcam-s2s | cut -f 2,3 -d "|" > $tmpfile2
sed -e 's/|/ up: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c camd3) -ne 0 ] ; then
echo "camd3:" >> $tmpfile
echo "-----------" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep camd3 | cut -f 2,3 -d "|" > $tmpfile2
sed -e 's/|/ up: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c gbox) -ne 0 ] ; then
echo "gbox:" >> $tmpfile
echo "-----------" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep gbox | cut -f 2,3 -d "|" > $tmpfile2
sed -e 's/|/ up: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c newcamd) -ne 0 ] ; then
echo "newcamd:" >> $tmpfile
echo "-----------" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep newcamd | cut -f 2,3 -d "|" > $tmpfile2
sed -e 's/|/ up: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
fi
if [ $(wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -c radegast) -ne 0 ] ; then
echo "Radegast:" >> $tmpfile
echo "-----------" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/servers[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep radegast | cut -f 2,3 -d "|" > $tmpfile2
sed -e 's/|/ up: /g' $tmpfile2 >> $tmpfile
echo "" >> $tmpfile
fi
echo "-----------------------------------------------" >> $tmpfile
echo "Clientinfo:" >> $tmpfile
echo "" >> $tmpfile
wget -q -O - "[URL]http://$WUP$URL:$PORT[/URL]" | while
true
do
read line
read line
connectedClients=${line#*<BR>*}
echo $connectedClients >> $tmpfile
read line
activeClients=${line#*<BR>*}
echo $activeClients >> $tmpfile
break
done
echo "" >> $tmpfile
wget -O - "[URL]http://$WUP$URL:$PORT/activeclients[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep 00d > $tmpfile2
cut -d\| -f2,3,9 $tmpfile2 | sed -e s/$/"\n"/g -e s/"|"/"\n"/2 -e s/"|"/" "/g >> $tmpfile
echo "-----------------------------------------------" >> $tmpfile
# echo "Client Connectinfo:" >> $tmpfile
# echo "" >> $tmpfile
# wget -O - "[URL]http://$WUP$URL:$PORT/clients[/URL]" 2>/dev/null | grep -v "^<[(HTML|/PRE)]" | grep [.] | cut -d\| -f2,4,8 > $tmpfile2
# sed -e 's/|/ /g' $tmpfile2 >> $tmpfile
# echo "" >> $tmpfile
# echo "-----------------------------------------------" >> $tmpfile
cat $tmpfile
rm -f /tmp/cccam.0*
#!/bin/sh
#set -x
#Functions
function SendEMail ()
{
FROM="`hostname`@fqdn.net"
TO="user[EMAIL="s@fqdn.net"]@fqdn.net[/EMAIL]"
SMTP="mail.fqdn.net"
BETREFF="CCcam Neustart :-("
INHALT="CCcam Server musste neu gestartet werden."
echo Sende Logdateien per E-Mail...
sendEmail -f $FROM -t $TO -u $BETREFF -m $INHALT -s $SMTP
}
#MAIN
timestamp=`date +"%Y-%m-%d %H:%M"`
process=`ps auxwww | grep CCcam.x86 | grep -v grep | awk '{print $1}'`
if [ -z "$process" ]; then
echo "$timestamp ERROR CCcam Server musste neu gestartet werden :-(" >> /var/log/cccam.check
cccam start
SendEMail
else
echo "$timestamp OK CCcam Server laeuft :-)" >> /var/log/cccam.check
fi
exit 0
* Restarting authentication failure monitor fail2ban
* Socket file /var/run/fail2ban/fail2ban.sock is present [fail]
2009-08-27 18:40:47,153 fail2ban.server : ERROR Unexpected communication error
update-rc.d cccamwatchdogd defaults 99
/etc/init.d/cccamwatchdogd start
Vor die Befehle einfach sudo eingeben :dance3:ich brauche bitte hilfe um alles hin zu kriegen mit befehle unter Ubuntu usw..
ich hab oooooooo Ahnung mit Linux
hallo leute ! ich habe auch ein problem !! und zwar kann ich aus dem netzwerk heraus auf /stats und /cccam zugreifen ! aber über internet krieg ich es nicht zu gange ! welche ports muss ich da im router weiterleiten um auf das web interface zugriff zu bekommen ?
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?