Quantcast
Aktuelles
Digital Eliteboard - Das Digitale Technik Forum

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

Registriere dich noch heute kostenlos, um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereichen, welche für Gäste verwehrt bleiben

Suche für Raspberry aktuelle OSCAM mit EMU

G

Gelöschtes Mitglied 332819

Guest
Hallo,

suche für meinen RaspberryPI Server eine aktuelle OSCAM mit EMU Support (gepatcht). Eine ältere vom Februar habe ich am laufen. Es gibt zwar die HDSC-Oscam-HDSC mit EMU Support doch die aktuellen HDSC- Oscam nach Build r10347 haben einen Reader Bug.

Vielen dank im voraus.

Cu
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

Vielen dank für die Antwort. Ja habe IPC am laufen und funktioniert soweit alles sehr gut.
Den EMU kenne ich, habe ihn leider nach tagelanger versuche nicht zum laufen bekommen. Es kommt folgende Fehlermeldung im Webinterface:

box2 (0D05@000004/0000/32C9/9C:EC692A33093D36C35096DE47456251EE): timeout (5001 ms) by OSEmu - ORF1

SoftCam.Key ist im Verzeichnis var/keys vorhanden.

Du musst angemeldet sein, um Bilder zu sehen.


Cu
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

Oh sry hier die aktuellen cfg der OSCAM:


OSEmu.armel neu erstellt über telnet mit o compile.



Telnet Auszug:
root@raspberrypi ~ > oe status
[ ok ] OSEmu is running.
root@raspberrypi ~ >




OSCAM VERSION:
Unix starttime: 1435493643
Starttime: 28.06.2015 14:14:03
Version: oscam-1.20-unstable_svn-r10851
Compiler: arm-bcm2708hardfp-linux-gnueabi-libusb-pcsc
Box type: generic (generic)
ConfigDir: /var/etc/
WebifPort: 8086


Web interface support: yes
LiveLog support: yes
jQuery support intern: yes
Touch interface support: yes
SSL support: no
DVB API support: yes
DVB API with AZBOX support: no
DVB API with MCA support: no
DVB API with COOLAPI support: no
DVB API with STAPI support: no
DVB API with STAPI5 support: no
DVB API read-sdt charsets: yes
Irdeto guessing: yes
Anti-cascading support: yes
Debug mode: yes
Monitor: yes
Loadbalancing support: yes
Cache exchange support: yes
CW Cycle Check support: yes
LCD support: no
LED support: no
Clockfix with realtime clock: yes
IPv6 support: no


camd 3.3x: no
camd 3.5 UDP: yes
camd 3.5 TCP: yes
newcamd: yes
CCcam: yes
CCcam share: yes
gbox: yes
radegast: yes
scam: yes
serial: yes
constant CW: yes
Pandora: yes
ghttp: yes


Reader support: yes


Nagra: yes
Irdeto: yes
Conax: yes
Cryptoworks: yes
Seca: yes
Viaccess: yes
NDS Videoguard: yes
DRE Crypt: yes
TONGFANG: yes
Bulcrypt: yes
Griffin: yes
DGCrypt: yes


cardreader_phoenix: yes
cardreader_internal_azbox: no
cardreader_internal_coolapi: no
cardreader_internal_sci: yes
cardreader_sc8in1: yes
cardreader_mp35: yes
cardreader_smargo: yes
cardreader_pcsc: yes
cardreader_smartreader: yes
cardreader_db2com: yes
cardreader_stapi: no
cardreader_stapi5: no
cardreader_stinger: yes


oscam.config
# oscam.conf generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r10851# Read more:


[global]
loghistorysize = 5000
logfile = /tmp/oscam.log
pidfile = /tmp/oscam.pid
unlockparental = 1
nice = -10
maxlogsize = 100
waitforcards = 0
preferlocalcards = 1
usrfile = /tmp/user.log
emmlogdir = /V14-log/


[cache]


[cccam]
port = 3
nodeid = D384F027103A14EC
version = 2.3.0
reshare = 2
reshare_mode = 0
recv_timeout = 4000


[webif]
httpport = 8086
httpuser = NAME
httppwd = PASSWORT
httpcss = /var/etc/black.css
httppiconpath = /picons
httphelplang = de
httprefresh = 480
httppollrefresh = 10
httpshowpicons = 1
httppiconsize = 50
httpallowed = 0.0.0.0-255.255.255.255
httposcamlabel = Oscam WebInterface

oscam.user
[account]user = dbox2
pwd = dbox2
keepalive = 1
au = 1
group = 3
cccmaxhops = 2
cccreshare = 4

oscam.server
# oscam.server generated automatically by Streamboard OSCAM 1.20-unstable_svn SVN r10851# Read more:


[reader]
label = SKY-V14
description = V14 (NDS)
protocol = mouse
device = /dev/ttyUSB1
caid = 098C
boxid = 12345678
ins7e11 = 15
detect = cd
group = 1
emmcache = 1,1,10,0
blockemm-unknown = 1
blockemm-u = 1
blockemm-s = 1
blockemm-g = 1
saveemm-u = 1
lb_weight = 1000
ndsversion = 2


[reader]
label = HD+
description = HD01 weisse Karte (NAGRA)
protocol = mouse
device = /dev/ttyUSB0
caid = 1830
boxkey = A..............C
rsakey = B..............................................................................................................................................................................................5
detect = cd
group = 2
emmcache = 1,1,2,0
saveemm-u = 1
lb_weight = 1000


[reader]
label = OSEmu
protocol = cs357x
device = 127.0.0.1,54321
user = emu
password = emu
caid = 0D00,0D02,0D03,0D05,090F
ecmwhitelist = 0D00:9C,84,87,8B,BF,C3,6D;0D02:84;0D03:9C,9F,A5;0D05:9C;090F:62,73,84,94,95,96,99,A6,B7
ident = 0D00:000000,000004,000010,000014,000020,0000C0,0000C4,0000CC;0D02:00008C,0000A0,0000A4,0000A8;0D03:000004,000008,000024,000028;0D05:000004,000010;090F:000000
group = 3
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

Leider keine Funktion:


2015/06/28 15:51:12 01269C08 h (reader) OSEmu [cs357x] Restarting reader
2015/06/28 15:51:12 01269C08 h (reader) OSEmu [cs357x] creating thread for device 127.0.0.1
2015/06/28 15:51:12 01299D48 p (reader) OSEmu [cs357x] proxy 127.0.0.1:54321
2015/06/28 15:51:12 01299D48 p (reader) OSEmu [cs357x] proxy initialized, server 127.0.0.1:54321
2015/06/28 15:51:15 01299D48 p (reader) 127.0.0.1: resolved ip=127.0.0.1
2015/06/28 15:51:15 01299D48 p (reader) OSEmu [cs357x] connecting to 127.0.0.1:54321
2015/06/28 15:51:20 0128B2E8 c (ecm) dbox2 (0D05@000004/0000/32CA/9C:A95AE35E690F884AB171047BEE325410): timeout (5002 ms) by OSEmu - ORF2
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

Ja auch schon die Oscam per Telnet mit "oe compile" kompiliert. Die aktuelle OScam Version ist damit heruntergeladen und installiert.
Wie oben erwähnt liegt die aktuelle SoftCam.key im Verzeichnis /var/keys.

Danke für die Hilfe.
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

Nimm mal diese Readereinstellungen und starte neu (Oscam + Osemu > o restart > oe restart):

Code:
[reader]
label                         = OSEmu
protocol                      = cs357x
device                        = 127.0.0.1,54321
user                          = emu
password                      = emu
caid                          = 0D00,0D02,0D03,0D05,090F,0500,1801,0604,2600,FFFF
ident                         = 0D00:000000,000004,000010,000014,000020,0000C0,0000C4,0000CC;0D02:000000,00008C,0000A0,0000A4,0000A8;0D03:000000,000004,000008,000024,000028;0D05:000000,000004,000010;090F:000000;0500:000000,030B00,023800,021110,007400,007800;1801:000000;0604:000000;2600:000000;FFFF:000000
[COLOR=#ff0000]group                         = 1 # anpassen! group = 3 (?)[/COLOR]
via_emm_global                = 1
 
AW: Suche für Raspberry aktuelle OSCAM mit EMU

oscam.server angepasst:

[reader]label = OSEmu
protocol = cs357x
device = 127.0.0.1,54321
user = emu
password = emu
caid = 0D00,0D02,0D03,0D05,090F,0500,1801,0604,2600,FFFF
ident = 0D00:000000,000004,000010,000014,000020,0000C0,000 0C4,0000CC;0D02:000000,00008C,0000A0,0000A4,0000A8 ;0D03:000000,000004,000008,000024,000028;0D05:0000 00,000004,000010;090F:000000;0500:000000,030B00,02 3800,021110,007400,007800;1801:000000;0604:000000; 2600:000000;FFFF:000000
group = 1,2,3
via_emm_global = 1


Leider gar nix:

2015/06/28 16:10:12 00C41E50 c (ecm) dbox2 (0D05@000004/0000/32CA/9C:61824C9EA8ADF9275A62E3649FAE391C): timeout (5000 ms) by OSEmu - ORF2



Benutzername Port sind auch richtig:
/var/emu/script/functions.sh

#!/bin/bash# IPC - Functions - 32bit
#
#
# set -x #debug


#++++++++++++++++++++++++++++++ VARIABLES ++++++++++++++++++++++++++++++


IPCVERSION="11.5"


AUTORUN=/etc/rc.local
IPCCONFIG="/var/emu/conf/ipc.cfg"
CAMCONFIGS="/var/etc"
CAMBINS="/var/emu"
CAMLOGS="/var/log/ipc"
CAMJOBS=/etc/crontab


CCNAME="CCcam"
CCVERSION="CCcam.x86"
CCBIN="$CAMBINS/cccam/$CCVERSION"
CCURL="localhost"
CCWWW="/var/www/ipc"
CCCFG="$CAMCONFIGS/CCcam.cfg"
CCCFGNEW="$CAMCONFIGS/CCcam.cfg.new"
CCCFGBAK="$CAMCONFIGS/CCcam.cfg.old"
CCCHANGELOG="$CAMLOGS/CCcam-changes.log"


OENAME="OSEmu"
OEVERSION="OSEmu.armel"
OEBIN="$CAMBINS/osemu/$OEVERSION"
OEUSER="emu"
OEPASS="emu"
OEPORT="54321"


OSNAME="OScam"
OSVERSION="oscam.armel"
OSBIN="$CAMBINS/oscam/$OSVERSION"
OSCFG="$CAMCONFIGS/oscam.conf"
OSSERVER="$CAMCONFIGS/oscam.server"
OSUSER="$CAMCONFIGS/oscam.user"
OSERVICES="$CAMCONFIGS/oscam.services"
OSRVID="$CAMCONFIGS/oscam.srvid"
OSLOGFILE="$CAMLOGS/OScam.log"
OSTMP="/tmp/.oscam"


CDNAME="Camd3"
CDVERSION="camd3.x86"
CDBIN="$CAMBINS/camd3/$CDVERSION"
CDCFG="$CAMCONFIGS/camd3.config"
CDSERVERS="$CAMCONFIGS/camd3.servers"
CDUSERS="$CAMCONFIGS/camd3.users"
CDLOGFILE="$CAMLOGS/camd3.log"


NCSNAME="NewCS"
NCSVERSION="newcs.armel"
NCSBIN="$CAMBINS/newcs/$NCSVERSION"
NCSXML="$CAMCONFIGS/newcs.xml"
NCSLOG="$CAMLOGS/newcs.log"


SBNAME="sBox"
SBVERSION="sbox.x86"
SBBIN="$CAMBINS/sbox/$SBVERSION"
SBCFG="$CAMCONFIGS/sbox.conf"
SBLOGFILE="/tmp/sbox.log"


CUSTOMNAME=""
CUSTOMVERSION="oscam.x86"
CUSTOMBIN="$CAMBINS/oscam/$CUSTOMVERSION"
CUSTOMCFG="$CAMCONFIGS/oscam.conf"
CUSTOMLOGFILE="$CAMLOGS/OScam.log"
CUSTOMTMP=""


BACKUPDIR="/var/backups/ipc"
TMPDIR="/var/emu/tmp/script"
TMPFILE1="$TMPDIR/CCcam1.tmp"
TMPFILE2="$TMPDIR/CCcam2.tmp"
TIMESTAMP=`date +"%Y%m%d_%H%M%S"`
TIMESTAMP2=`date +"%Y-%m-%d %H:%M"`


INFOPHP_CONFIG=/var/www/ipc/infophp/config.php
INFOPHP_WORKPATH='/var/emu/tmp/infophp/'
INFOPHP_UPDATEFROMBUTTON='true'
INFOPHP_FULLRESHARE='true'
INFOPHP_COUNTRYWHOIS='true'


IPURL="http://ipc.pebkac.at/ipc"
FMURL="http://ipc.pebkac.at/forum"
WIKIURL="http://ipc.pebkac.at/wiki"


SHSETUP=ipcsetup.sh
SupportedCams="OScam OSEmu NewCS"
CAMSbackup="$CAMBINS/BACKUP"


WEBIF_MenueAccessFile="/var/emu/conf/.webmenueaccess"
WEBIF_DEFAULTmenueaccess="Home;Forum"
WEBIF_EMailsDB="/var/www/ipc/page/include/EMails.db"
WEBIF_DefaultStartFile="/var/emu/conf/.webdefaultstart"
WEBIF_SQLITEdb="/var/www/ipc/page/include/webif.db"
WEBIF_FAILEDauthLOG="/var/www/ipc/page/include/WEBIF_FAILEDauth.log"


SQLITEtable["1"]="CREATE TABLE IF NOT EXISTS auth (id INTEGER PRIMARY KEY,user TEXT,pass TEXT,created INT,lastvisit INT,online INT DEFAULT '0',ip TEXT,lastlogin INT);"
SQLITEtable["2"]="CREATE TABLE IF NOT EXISTS pm (id INTEGER PRIMARY KEY,fromid INT,toid INT,created INT,message TEXT);"
SQLITEtable["3"]="CREATE TABLE IF NOT EXISTS settings (id INTEGER PRIMARY KEY,user_id INT,setting TEXT,value TEXT);"
SQLITEtable["4"]="CREATE TABLE IF NOT EXISTS emails (id INTEGER PRIMARY KEY,user TEXT,email TEXT,grp TEXT);"
SQLITEtableName["1"]="auth"
SQLITEtableName["2"]="pm"
SQLITEtableName["3"]="settings"
SQLITEtableName["4"]="emails"


AddOnInfos="/var/emu/conf/addons.info"
NOADDON="camd3-softkey.sh oscam-compile.sh oscam-precomp.sh softkey.sh update_webif_help.sh"


#++++++++++++++++++++++++++++++ VARIABLES ++++++++++++++++++++++++++++++


#++++++++++++++++++++++++++++++ FUNCTIONS ++++++++++++++++++++++++++++++


# Favorit Editor..
[ -z "$useEDITOR" ] && useEDITOR="nano"


# Tempdir erstellen, Rechte setzen, leeren
tempdir() {
#echo "Function: tempdir"
[ ! -d $TMPDIR ] && mkdir -p $TMPDIR && chmod 777 -R $TMPDIR >/dev/null 2>&1
rm -f $TMPDIR/* >/dev/null 2>&1
cd $TMPDIR
}


# Rechte setzen
setrights() {
#check /etc/rc.local
[ ! -x "/etc/rc.local" ] && chmod u+x /etc/rc.local >/dev/null 2>&1
OWNER="www-data:www-data"
chown -R $OWNER /var/etc /var/keys > /dev/null 2>&1
chmod 755 /var/etc > /dev/null 2>&1
#CCcam.cfg - Rechte und Besitzer
chown $OWNER $CCCFG > /dev/null 2>&1
#CCcam key files
chmod 755 /var/keys/CCcam.* >/dev/null 2>&1
chown $OWNER /var/keys/CCcam.* >/dev/null 2>&1
#OScam config files
chmod 755 $OSCFG >/dev/null 2>&1
chmod 755 $OSSERVER >/dev/null 2>&1
chmod 755 $OSUSER >/dev/null 2>&1
chmod 755 $OSERVICES >/dev/null 2>&1
chmod 755 $OSRVID >/dev/null 2>&1
chown $OWNER $OSCFG >/dev/null 2>&1
chown $OWNER $OSSERVER >/dev/null 2>&1
chown $OWNER $OSUSER >/dev/null 2>&1
chown $OWNER $OSERVICES >/dev/null 2>&1
chown $OWNER $OSRVID >/dev/null 2>&1
#NewCS config file
chmod 755 $NCSXML >/dev/null 2>&1
chown $OWNER $NCSXML >/dev/null 2>&1
#EMU
chmod 755 -R /var/emu > /dev/null 2>&1
chmod 777 -R /var/emu/tmp > /dev/null 2>&1
chown -R $OWNER /var/emu/tmp > /dev/null 2>&1
#Changelog - Erstellen, Rechte, Besitzer
[ ! -f $CCCHANGELOG ] && echo "" > $CCCHANGELOG > /dev/null 2>&1
chmod 755 $CCCHANGELOG > /dev/null 2>&1
chown $OWNER $CCCHANGELOG > /dev/null 2>&1
#InfoPHP Tempdir und Rechte
[ ! -d $INFOPHP_WORKPATH ] && mkdir -p $INFOPHP_WORKPATH > /dev/null 2>&1
chmod 777 -R $INFOPHP_WORKPATH > /dev/null 2>&1
chown -R $OWNER $INFOPHP_WORKPATH > /dev/null 2>&1
chown $OWNER $INFOPHP_CONFIG > /dev/null 2>&1
#WebAccess
chown $OWNER $WEBIF_webaccess >/dev/null 2>&1
chown $OWNER $WEBIF_MenueAccessFile >/dev/null 2>&1
#WebIf
chown -R $OWNER /var/www/ipc >/dev/null 2>&1
[ -d "/var/www/oscaminfo" ] && chown -R $OWNER /var/www/oscaminfo >/dev/null 2>&1
[ -d "/var/www/ui" ] && chown -R $OWNER /var/www/ui >/dev/null 2>&1
}


# Paket Konfiguration auslesen
readipccfg() {
#echo "Function: readipccfg"
source $IPCCONFIG
}


# CCcam.cfg Konfiguration auslesen
readcccamcfg() {
#echo "Function: readcccamcfg"
CCUSER=$(grep -i "WEBINFO USERNAME" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
CCPASS=$(grep -i "WEBINFO PASSWORD" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
CCPORT=$(grep -i "WEBINFO LISTEN PORT" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
CCCHAN=$(grep -i "CHANNELINFO FILE" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
CCPROV=$(grep -i "PROVIDERINFO FILE" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
CCSPORT=$(grep -i "SERVER LISTEN PORT" $CCCFG | cut -d ":" -f2 | sed -e 's/ //g' | sed -e 's/\r//g')
[ "$CCSPORT" = "" ] && CCSPORT="12000"
[ "$CCPORT" = "" ] && CCPORT="16001"
#echo "CCUSER: $CCUSER"
#echo "CCPASS: $CCPASS"
#echo "CCPORT: $CCPORT"
}


# Teste ob CCcam laeuft
cccamrun() {
#echo "Function: cccamrun"
PID="$(pgrep -x $CCVERSION)"
if [[ ! -z $PID ]] ; then
dummy="1"
#echo "CCcam laeuft"
else
echo "CCcam ist nicht gestartet"
exit 1
fi
}


# Weblogin testen
weblogon() {
#echo "Function: weblogon"
WUP=""
[ "$CCUSER" != "" ] && WUP="$CCUSER:$CCPASS@"
CCWEBIF="http://$WUP$CCURL:$CCPORT"
WEBLOGIN=$(wget -q -O - $CCWEBIF)
[[ -z $WEBLOGIN ]] && clear && echo "CCcam Weblogon ERROR!" && exit 1
}


# E-Mail senden
mailsend() {
readipccfg
if [ -n "$SMTPTLS" ]; then
[[ $SMTPTLS == 1 ]] && OPT="-o tls=yes" || OPT="-o tls=no"
else
OPT=""
fi
echo "Sende E-Mail..."
sendEmail -f $SMTPFROM -t $SMTPTO -u $1 -m $2 $OPT -s $SMTPSERVER -xu $SMTPUSER -xp $SMTPPASS
}


# InfoPHP Konfiguration schreiben
infophpconfwrite() {
echo "<?php" >> $TMPFILE1
echo "" >> $TMPFILE1
echo "// CONFIG CCcamInfoPhp" >> $TMPFILE1
echo "// Diese Config wird automatisch beim schliessen von [cccam cfg] erzeugt!" >> $TMPFILE1
echo "" >> $TMPFILE1
echo '$CCCamWebInfo[] = array("'$CCURL'","'$CCPORT'","'$CCUSER'","'$CCPASS'"); //Hier die Infos aus der CCcam.cfg eintragen' >> $TMPFILE1
echo "" >> $TMPFILE1
echo '$work_path = "'$INFOPHP_WORKPATH'"; // Verzeichnis der temporaeren InfoPhp Dateien' >> $TMPFILE1
echo '$update_from_button = '$INFOPHP_UPDATEFROMBUTTON'; // Update Button anzeigen?' >> $TMPFILE1
echo '$fullReshare = '$INFOPHP_FULLRESHARE'; // Reshareanzahl der Pairkarten anzeigen?' >> $TMPFILE1
echo '$country_whois = '$INFOPHP_COUNTRYWHOIS'; // Laenderkennzeichen anzeigen?' >> $TMPFILE1
echo '$password = "'$INFOPHP_PASS'"; // InfoPhp Loginseite Kennwort' >> $TMPFILE1
echo "" >> $TMPFILE1
echo "?>" >> $TMPFILE1
if [ -f $INFOPHP_CONFIG ] ; then
cp -f $TMPFILE1 $INFOPHP_CONFIG
echo ""
echo -e "\033[1;37mInfoPHP Konfiguration wurde uebertragen\033[0m"
else
echo -e "\033[1;31m$INFOPHP_CONFIG existiert nicht!\033[0m"
fi
rm -f $TMPDIR/*
}


# enable/disable cam in /etc/crontab and /etc/rc.local
function change_cam_jobs_as () {
CAM=$1
ACTION=$2
if [ "$ACTION" == "on" ]; then
F=crontab
sed -e "s=^#\(.*$CAM-watchdog\)=\1=" /etc/$F >/tmp/$F && mv /tmp/$F /etc/$F
F=rc.local
sed -e "s=^#\(.*$CAM start\)=\1=" /etc/$F >/tmp/$F && mv /tmp/$F /etc/$F
fi
if [ "$ACTION" == "off" ]; then
F=crontab
sed -e "/^[^#].*$CAM-watchdog/s/^/#/" /etc/$F >/tmp/$F && mv /tmp/$F /etc/$F
F=rc.local
sed -e "/^[^#].*$CAM start/s/^/#/" /etc/$F >/tmp/$F && mv /tmp/$F /etc/$F
fi
chmod u+x /etc/rc.local >/dev/null 2>&1
}


# which Language..
function GetLanguage () {
readipccfg
IPCconfDIR=$(echo $IPCCONFIG|sed -e "s/$(basename $IPCCONFIG)//g")
for l in $(ls ${IPCconfDIR}langs/*); do
if [ "$DEFAULTlanguage" == "$(basename $l .sh)" ]; then
. $l
break
fi
done
}


function collect_needed_packs () {
InstallPAK=""
for PACK in $1; do
if [ -z "$(dpkg -l | grep "ii" | awk {'print $2'} | grep -xi $PACK)" ]; then
[ -z "$InstallPAK" ] && InstallPAK="$PACK" || InstallPAK="$InstallPAK $PACK"
fi
done
}


function check4installed_sqlite () {
#collect_needed_packs "sqlite3 php5-sqlite"
if [ -n "$InstallPAK" ]; then
apt-get clean >/dev/null
apt-get install -yf $InstallPAK >/dev/null 2>&1
fi
}


function sqlite_check_table () {
dbRESULT=$(sqlite3 $WEBIF_SQLITEdb "SELECT count(name) FROM sqlite_master WHERE type='table' AND name=\"$1\"")
echo "$dbRESULT"
}


function sqlite_create_tables () {
#check4installed_sqlite
RETURN=0
if [ -z "$1" ]; then
for index in ${!SQLITEtableName
[*]}; do
[ "$(sqlite_check_table ${SQLITEtableName[$index]})" == "1" ] && continue
dbRESULT=$(sqlite3 $WEBIF_SQLITEdb "${SQLITEtable[$index]}")
[ -z "$dbRESULT" ] && RETURN=1
done
else
if [ "$(sqlite_check_table $1)" == "1" ]; then
RETURN=1
else
for index in ${!SQLITEtableName
[*]}; do
if [ "${SQLITEtableName[$index]}" = "$1" ]; then
dbRESULT=$(sqlite3 $WEBIF_SQLITEdb "${SQLITEtable[$index]}")
[ -z "$dbRESULT" ] && RETURN=1
fi
done
fi
fi
echo $RETURN
}


# sqlite - create webif auth db file..
function sqlite_create_auth_db () {
#check4installed_sqlite
#STRUCTURE="${SQLITEtable[1]}"
#cat /dev/null > $WEBIF_SQLITEdb
#echo "$STRUCTURE" > /tmp/tmpstructure
#sqlite $WEBIF_SQLITEdb < /tmp/tmpstructure
#rm -f /tmp/tmpstructure
sqlite3 $WEBIF_SQLITEdb "${SQLITEtable[1]}"
chown www-data:www-data $WEBIF_SQLITEdb
}


# sqlite - get webif user fields
function sqlite_get_user () {
[ ! -f $WEBIF_SQLITEdb -o $(sqlite_check_table auth) == 0 ] && sqlite_create_auth_db
dbRESULT=$(sqlite3 $WEBIF_SQLITEdb "SELECT user FROM auth WHERE user=\"$1\"")
if [ ! -z "$dbRESULT" ]; then
echo $(sqlite3 $WEBIF_SQLITEdb "SELECT $2 FROM auth WHERE user=\"$1\"")
else
echo ""
fi
}


# sqlite - write webif user/pass
function sqlite_write_userpass () {
[ ! -f $WEBIF_SQLITEdb -o $(sqlite_check_table auth) == 0 ] && sqlite_create_auth_db
dbRESULT=$(sqlite_get_user "$1" pass)
md5passhash=$(echo -n "$2"|md5sum|cut -d" " -f1)
if [ ! -z "$dbRESULT" ]; then
dbEXEC=$(sqlite3 $WEBIF_SQLITEdb "UPDATE auth SET pass=\"$md5passhash\" WHERE user=\"$1\"";)
else
dbEXEC=$(sqlite3 $WEBIF_SQLITEdb "INSERT INTO auth (user,pass,created) VALUES (\"$1\",\"$md5passhash\",\"$(date +%s)\")";)
fi


# dbLIST=( $(sqlite3 $WEBIF_SQLITEdb "SELECT * FROM auth WHERE 1") )
# oldIFS=$IFS ; IFS=$'\n'
# for ROW in "${dbLIST[@]}"; do
# # Parsing data (sqlite returns a pipe separated string)
# ID=$(echo $ROW | awk '{split($0,a,"|"); print a[1]}')
# USER=$(echo $ROW | awk '{split($0,a,"|"); print a[2]}')
# PASS=$(echo $ROW | awk '{split($0,a,"|"); print a[3]}')
# # Printing my data
# echo "$ID) "$USER" -> "$PASS;
# done
# IFS=$oldIFS
}


# sqlite - delete webif user
function sqlite_delete_user () {
[ ! -f $WEBIF_SQLITEdb -o $(sqlite_check_table auth) == 0 ] && sqlite_create_auth_db
dbRESULT=$(sqlite3 $WEBIF_SQLITEdb "SELECT user FROM auth WHERE user=\"$1\"")
if [ ! -z "$dbRESULT" ]; then
echo $(sqlite3 $WEBIF_SQLITEdb "DELETE FROM auth WHERE user=\"$1\"")
else
echo ""
fi
}


# get all oscam protocol ports
function get_oscam_ports () {
declare -A OSPORT
OSPORT["newcamd"]=0 ;#newcamd (tcp)
OSPORT["cccam"]=0 ;#cccam (tcp)
OSPORT["csp"]=0 ;#csp (tcp)
OSPORT["camd33"]=0 ;#camd33 (tcp)
OSPORT["cs357x"]=0 ;#camd35 / cs357x (udp)
OSPORT["cs378x"]=0 ;#camd35 / cs378x (tcp)
OSPORT["radegast"]=0 ;#radegast (tcp)
OSPORT["gbox"]=0 ;#gbox (tcp)
UDP="cs357x"
UDPuse=0
while read line; do
Break=0
line=$(echo $line | sed -e 's/ //g')
for index in ${!OSPORT
[*]}; do
if [ "${OSPORT[$index]}" == "1" ]&&[ "$(echo $line | cut -d'=' -f 1)" = "port" ]; then
if [ "$index" == "newcamd" ]; then
ports=""
PORTSline=$(echo $line | cut -d'=' -f 2-)
for p in $(echo $PORTSline | tr ';' ' '); do
for pp in $(echo $p | cut -d'@' -f1); do
[ -z "$ports" ] && ports="$pp" || ports+=" $pp"
done
done
OSPORT["$index"]=$ports
elif [ "$index" == "cccam" ]; then
OSPORT["$index"]=$(echo $line | cut -d'=' -f 2- | tr "," " ")
else
OSPORT["$index"]=$(echo $line | cut -d'=' -f 2-)
fi
Break=1
break
fi
done
[ "$Break" == "1" ] && continue
for index in ${!OSPORT
[*]}; do
if [[ "$line" = "[$index]" ]]; then
OSPORT["$index"]=1
fi
done
done < $OSCFG
for index in ${!OSPORT
[*]}; do
[ "${OSPORT[$index]}" == "0" -o "${OSPORT[$index]}" == "1" ] && unset OSPORT[$index] >/dev/null 2>&1
done
# check if there are udp ports in use..
for udp in $UDP; do
[ ! -z "${OSPORT[$udp]}" ] && UDPuse=1
done
# only for debug:
if [ -n "$1" -a "$1" == "-debug" ]; then
for p in ${!OSPORT
[*]}; do
echo "$p: ${OSPORT[$p]}"
done
fi
}


Telnet Auszug:



root@raspberrypi ~ > o restart
OScam : restart
OScam : beendet
OScam : gestartet
root@raspberrypi ~ > oe restart
[ ok ] Stopping OSEmu: OSEmu.armel.
[ ok ] Starting OSEmu: OSEmu.armel.
root@raspberrypi ~ >
 
Zurück
Oben