Improve shellscript so it will work with softlinks to the script.