Bash script to ensure a command is only run once in N seconds