- Registriert
- 11. September 2010
- Beiträge
- 23.028
- Lösungen
- 11
- Reaktionspunkte
- 72.398
- Punkte
- 1.103
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
#!/bin/bash
#
#### CONFIG - START
## OScam WebIf with SSL? [1=yes , 0=no]
OSssl="0"
## /path/to/oscam.conf?
OScfg="/var/etc/oscam.conf"
## Cards to monitor
CARD["1"]="mille"
CARD["2"]="sky"
CARD["3"]="skd"
CARD["4"]="skdhd"
## monitoring Error message (%CARDNAME% gets replaced by the script (its a placeholder!))
## multible error messages possible, simple add for each an own array
OSerror["1"]="ERROR Phoenix_GetStatus: ioctl error in card detection for %CARDNAME%"
OSerror["2"]="%CARDNAME% .* Input/output error"
## OScam's Logfile?
OSlog="/var/log/oscam.log"
## reporting logfile for this script?
OStolog="/var/log/oscam.error"
#### CONFIG - END
OSip="127.0.0.1"
[ "$OSssl" = 1 ] && URL="https://" || URL="http://"
# Simple URL encoding
proc_url_encode() {
out=${1//%/%25}; out=${out//\{/%7B}; out=${out//\}/%7D}; out=${out//|/%7C};
out=${out//\\/%5C}; out=${out//^/%5E}; out=${out//~/%7E}; out=${out//[/%5B};
out=${out//]/%5D}; out=${out//\`/%60}; out=${out//#/%23}; out=${out//>/%3E};
out=${out//\$/%24}; out=${out//&/%26}; out=${out//+/%2B}; out=${out//,/%2C};
out=${out//\//%2F}; out=${out//:/%3A}; out=${out//;/%3B}; out=${out//=/%3B};
out=${out//\?/%3F}; out=${out// /%20}; out=${out//</%3C};
out=${out//\!/%21}; out=${out//\"/%22}; out=${out//\@/%40}; out=${out//\'/%27};
out=${out//\(/%28}; out=${out//\)/%29}; out=${out//\*/%2A}; out=${out//\-/%2D};
out=${out//\_/%5F}; out=${out//\./%2E}; out=${out//\€/%80};
echo $out
}
proc_parse_cfg() {
i=0
while read line; do
line=$(echo $line | sed -e 's/ //g')
if [[ "$line" =~ ^[^#]*= ]]; then
cfg_name[$i]=$(echo $line | cut -d'=' -f 1)
cfg_value[$i]=$(echo $line | cut -d'=' -f 2-)
((++i))
fi
done < $1
}
get_cfg_value() {
i=0
for name in ${cfg_name[@]}; do
[ "$1" = "$name" ] && echo "${cfg_value[$i]}" && break
((++i))
done
}
proc_get_infos() {
proc_parse_cfg $OScfg
WEBPORT=$(get_cfg_value httpport)
[ -z "$WEBPORT" ] && "ERROR: WebIf isnt enabled! Abort!" && exit 1
if [[ "$WEBPORT" =~ "\+" ]]; then
URL="https://"
WEBPORT=$(echo $WEBPORT | tr -d '+')
fi
USERNAME=$(get_cfg_value httpuser)
if [ ! -z "$USERNAME" ]; then
PASSWORD=$(get_cfg_value httppwd)
URL="$URL"`proc_url_encode "${USERNAME}"`":"`proc_url_encode "${PASSWORD}"`"@${OSip}:${WEBPORT}"
else
URL="${URL}$OSip:$WEBPORT"
fi
}
proc_get_infos
for card in "${CARD[@]}" ; do
for idx in "${!OSerror[@]}" ; do
Em=${OSerror[$idx]}
ERRORmsg=${Em//%CARDNAME%/$card}
founds=`tail -10 $OSlog | grep "$ERRORmsg" | wc -l`
if [ $founds -gt 0 ]; then
echo "`date +%d-%b-%Y` `date +%H:%M:%S`: $card Card lost" >> $OStolog
curl -s --digest "$URL/readers.html?label=${card}&action=disable" >/dev/null
curl -s --digest "$URL/readers.html?label=${card}&action=enable" >/dev/null
fi
done
done
exit 0
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Das Digital Eliteboard ist ein kostenloses Forum und ist auf Spenden angewiesen, um sich auch in Zukunft selbst zu finanzieren. Wenn auch du mit dem Digital Eliteboard zufrieden bist, würden wir uns über jede Unterstützung freuen.
Hier kannst du uns unterstützen SPENDEN