Linux system automatically restarts and counts shell scripts