Last active
August 29, 2015 14:12
-
-
Save duvrai/6c04887a4ba6cd9e6e3c to your computer and use it in GitHub Desktop.
Writes a random byte every minute to a .nosleep file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" ] | |
then | |
while true | |
do | |
date | |
for param in "$@" | |
do | |
echo Writing "$param/.nosleep" | |
head -c1 /dev/random >"$param/.nosleep" | |
done | |
sleep 60 | |
done | |
else | |
echo "Writes a random byte every minute to a .nosleep file" | |
echo "Usage:" | |
echo " nosleep directory [directory ...]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment