Denora Stats (discontinued) > Denora Development (Read Only)

[Update] denora.rc.in to support crontab operation

(1/1)

Alexander Maassen:
diff --git a/src/bin/denorarc.in b/src/bin/denorarc.in
index 72c96b5..78215fd 100644
--- a/src/bin/denorarc.in
+++ b/src/bin/denorarc.in
@@ -108,6 +108,15 @@ elif [ "$1" = "rehash" ] ; then
        echo "Saving Databases and Rehashing Configuration"
        kill -1 `cat $DENORAPID`

+elif [ "$1" = "cron" ] ; then
+       if [ -f $DENORAPID ] ; then
+               PID=`cat $DENORAPID`
+               if [ `ps auxw | grep $DENOPROG | grep $PID | grep -v -c grep` = 1 ] ; then
+                       exit 1
+               fi
+       fi
+       $DENOPROG
+
 elif [ "$1" = "version" ] ; then
        $DENOPROG -version

@@ -125,6 +134,7 @@ elif [ "$1" = "help" ] ; then
                echo "$0 status         Show Denora's Status"
                echo "$0 restart        Restart Denora (Databases will be saved)"
                echo "$0 rehash         Rehash Configuration and Save Databases"
+               echo "$0 cron           Start denora if not running (usefull for crontab)"
                echo "$0 version        Return Denora Version and Build Information"
                echo "$0 help           Show this help menu"
                echo "If you need further help please check the /docs/"
@@ -134,5 +144,5 @@ elif [ "$1" = "help" ] ; then

 else
        echo "Denora Remote Control ($DRCVERSION)"
-       echo "Usage: $0 [start|stop|status|restart|rehash|version|help]"
+       echo "Usage: $0 [start|stop|status|restart|rehash|cron|version|help]"
 fi

Navigation

[0] Message Index

Go to full version