
- Κώδικας: Επιλογή όλων
#!/bin/bash
oldip="" currentip=""
while ping -c1 checkip.dyndns.org >/dev/null
do
currentip=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
if [ "$currentip" != "$oldip" ];
then
sendmail "blabla"
fi
sleep 15m
done
#!/bin/bash
oldip="" currentip=""
while ping -c1 checkip.dyndns.org >/dev/null
do
currentip=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
if [ "$currentip" != "$oldip" ];
then
sendmail "blabla"
fi
sleep 15m
done
#!/bin/bash
#MailIP.sh
oldIP=""
while true
do
until ping -c1 www.ip-adress.com > /dev/null
do
sleep 10s
done
newIP=`w3m http://www.ip-adress.com | grep is: | cut -d" " -f 5`
if [ "$oldIP" != "$newIP" ];
then
sendEmail -f from@this.email -t to@this.email -u "IP Changed" -m "Your new IP is $newIP " -s an.smtp.server
oldIP=$newIP
fi
sleep 15m
done
python eortlogio.py 0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This script fetches the feed: http://eortologio.gr/rss/si_el.xml
# from eortologio.gr
# and displays it as a notification
import sys
import time
import pynotify
import urllib2
import xml.dom.minidom
from xml.dom.minidom import Node
def downloadXMLFeed():
#Celebrating their name's day:
feedUrl = "http://eortologio.gr/rss/si_el.xml" #today
#feedUrl = "http://eortologio.gr/rss/si_av_el.xml" #today - tomorrow
#feedUrl = "http://eortologio.gr/rss/si_av_me_el.xml" #today - tomorrow - the day after tomorrow
feedContents = []
try:
xmlFile = urllib2.urlopen(feedUrl)
except:
return feedContents
doc = xml.dom.minidom.parse(xmlFile)
for node in doc.getElementsByTagName("item"):
if(node.hasChildNodes()):
for content in node.getElementsByTagName('title'):
tmp = content.childNodes[0].nodeValue
index = tmp.find(":")
title = tmp[0:index]
names = tmp[index+1:]
item = (title, names)
#print item
feedContents.append(item)
return feedContents
if __name__ == '__main__':
TITLE_PREFIX = "Εορτάζουν "
SLEEP_TIME = int(sys.argv[1]) # in seconds
time.sleep(SLEEP_TIME)
if not pynotify.init ("eortologio"):
sys.exit (1)
feedContents = downloadXMLFeed()
for item in feedContents:
n = pynotify.Notification (TITLE_PREFIX+item[0]+": ",item[1])
n.show ()
AmmarkoV έγραψε:Επίσης wtf , 591 "Ψηφιολέξεις" ?????
sudo apt-get install python-webkit python-gobject python-gtk2 python-gtk2-dev python-glade2 python-cairo