A naive shellscript, from my former gist