Skip to content

Instantly share code, notes, and snippets.

@withgod
Created January 30, 2013 09:17
Show Gist options
  • Save withgod/4671874 to your computer and use it in GitHub Desktop.
Save withgod/4671874 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# */2 * * * * /home/noname/bin/test.sh
#
SCREEN_NAME=test
SCREEN=/usr/bin/screen
cd $(dirname $0)
check_str=`$SCREEN -ls | grep $SCREEN_NAME | awk -F '[.\t]' '{print $3}'`
if [ "$check_str" = "" ]; then
$SCREEN -AmdS $SCREEN_NAME ./test.pl
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment