About a year ago, I was about to start my (mandatory) military service. The greek army is a place that gathers all the red tape madness that modern Greece has, augments it by a factor of ten, and then applies some more paperwork on top of it.

Luckily there is an effort to digitize all the things

digitize all things!

(Usually in the worst possible way)

So, the greek army, provides a way to check for your recruitment status online, (the alternative is to call your local police department and ask them if they have some crappy paper for you!).

That service is available at their recruitment site

That is a good thing.

But it can get better. So I created a small script to check that form every once in a while and notify my with an email if there was a change on the results!


MD5_OLD=_$(md5sum 'path_to_temp_output' | cut -d ' ' -f 1)

curl -X POST -d @/path/to/config/file
'http://www.stratologia.gr/proepiskophsh_stoixoivn' | grep -A 3
enhmKatataxisDiv > path_to_temp_output

MD5_NEW=_$(md5sum 'path_to_temp_output' | cut -d ' ' -f 1)

if [ "$MD5_OLD" != "$MD5_NEW" ]
  cat path_to_temp_output | mail -s 'ARMY update' the_email

where the config file is something like


(For that to work you need to have sendmail installed and running)

That code gets the results of the form submission and checks for a missmatch with the previous response via an md5 check. If there is a change, it sends the new response as an email.

So at February 19th of 2014 as I was fluffing some code about a new funky unicorn feature of Skroutz.gr, I received a totally disturbing email, concerning my future for the next 8.5 months.

PS1: This code is available as a gist in github army_checker
PS2: I must admit that I was happysad, the script worked and it was the moment of truth.