Re: Script: OScam "überwachung"
Verfasst: Sa 24. Dez 2011, 14:16
OK Danke an euch es lüpt jeztz oscam wird nun gestartet .
`--spider' When invoked with this option, Wget will behave as a Web "spider", which means that it will not download the
pages, just check that they are there. For example, you can use Wget to check your bookmarks:
wget --spider --force-html -i bookmarks.html
This feature needs much more work for Wget to get close to the functionality of real web spiders.
feissmaik hat geschrieben:Hier eine etwas konfortablere Version von mir vom obigen Code, um rausgeflogene Karten ohne OScam-restart wieder einzubinden:Code: Alles auswählen
#!/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" ## OScam's Logfile? OSlog="/var/log/oscam.log" ## monitoring Error message OSerror="ERROR Phoenix_GetStatus: ioctl error in card detection for %CARDNAME%" ## 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}; 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 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 ERRORmsg=${OSerror//%CARDNAME%/$card} founds=`tail -10 $OSlog | grep "$ERRORmsg" | wc -l` if [ $founds >= 1 ]; then echo "`date +%d-%b-%Y` `date +%H:%M:%S`: $card Card lost" >> $OStolog wget --spider "$URL/readers.html?label=${card}&action=disable" wget --spider "$URL/readers.html?label=${card}&action=enable" fi done exit 0
[CARD]'s ?? das sind keine cards das sind index-zahlen ... bitte poste dein verändertes script damit man sehen kann was du geändert hast - ob du das auch korrekt geändert hastMangaMango hat geschrieben:Hallo,
erstmal super Arbeit. Genau das was ich gesucht haben.
Habe nur einen kleinen Fehler, wenn ich das Script aufrufe:
"Zeile 81: [: 0: Einstelliger (unärer) Operator erwartet."
Habe das Script kopiert und nur die [CARD]'s und Pfade geändert.