Keresés

Új hozzászólás Aktív témák

  • vzoltan

    aktív tag

    válasz vzoltan #5527 üzenetére

    Egyszerusitve az elozot, igy nem ker phpt

    #!/bin/bash
    ## Quickly checks if I have new gmail

    echo -e "Checking for new messages... \c"

    wget -T 3 -t 1 --secure-protocol=TLSv1 \
    --no-check-certificate \
    --user=YOURACCOUNT --password=YOURPASSWORD \
    https://mail.google.com/mail/feed/atom -O atom.xml


    echo -e "\r\c"


    COUNT=`cat atom.xml | grep fullcount | sed 's/<[^>]*>//g' `
    OLD_COUNT=`cat atom_old.xml | grep fullcount | sed 's/<[^>]*>//g' `
    #test if count is read
    echo $COUNT

    #define old_count if necessary
    if [ "$OLD_COUNT" = "" ]
    then
    OLD_COUNT=0
    fi

    #compare values
    if [ $COUNT -gt $OLD_COUNT ]
    then
    #action!
    sudo killall boblight-constant
    sudo boblight-constant -p 120 -o value=0.6 FA0000 -f > /dev/null 2>&1
    sleep 2
    sudo killall boblight-constant
    sudo boblight-constant -p 120 -o value=0.6 FA0000 -f > /dev/null 2>&1
    sleep 2
    sudo killall boblight-constant
    OLD_COUNT=$COUNT
    fi
    cp atom.xml atom_old.xml

Új hozzászólás Aktív témák