Ubuntu Pastebin

Paste from madjoe at Tue, 1 Mar 2016 11:17:50 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/bin/bash

DISPLAY=":0.0"
XAUTHORITY="/home/me/.Xauthority"
XDG_RUNTIME_DIR="/run/user/1001"
fetch_url1=$(/usr/bin/wget -qO- http://mydomain.com/something.xml);

checkhep_title ()
{
notify_counter=0;
alert1='foo';
alert2='bar';
live=$(echo "$fetch_url1" | /bin/grep 'title' | /bin/grep -E "$alert1|$alert2" | /bin/sed -e 's/<[^>]*>//g' | /usr/bin/perl -MHTML::Entities -e 'while(<>) {print decode_entities($_);}');
[ $notify_counter -eq 0 ] && [[ "$live" == *"$alert1"* || "$live" == *"$alert2"* ]] && { /usr/bin/notify-send -t 20000 -u critical -i /home/me/Pictures/Misc/storm.png "ALERT ยป" "Description: $live"; /usr/bin/aplay /home/me/sound/sound.wav; notify_counter=1; }
}

/bin/sleep 30
checkhep_title &
Download as text