michael@529: #!@l_prefix@/bin/openpkg rc michael@529: ## michael@529: ## rc.drupal -- Run-Commands michael@529: ## michael@529: michael@529: %config michael@529: drupal_enable="$openpkg_rc_def" michael@529: drupal_cron="@l_drupal_cron@" michael@529: drupal_backup="daily" michael@529: michael@529: %status -u @l_susr@ -o michael@529: drupal_usable="no" michael@529: drupal_active="no" michael@529: @l_prefix@/sbin/apache -t \ michael@529: -f @l_prefix@/etc/drupal/drupal-apache.conf 2>/dev/null && \ michael@529: drupal_usable="yes" michael@529: [ -f @l_prefix@/var/drupal/run/apache.pid ] && \ michael@529: kill -0 `cat @l_prefix@/var/drupal/run/apache.pid` && \ michael@529: drupal_active="yes" michael@529: echo "drupal_enable=\"$drupal_enable\"" michael@529: echo "drupal_usable=\"$drupal_usable\"" michael@529: echo "drupal_active=\"$drupal_active\"" michael@529: michael@529: %start -u @l_susr@ michael@529: rcService drupal enable yes || exit 0 michael@529: rcService drupal active yes && exit 0 michael@529: @l_prefix@/sbin/apache \ michael@529: -f @l_prefix@/etc/drupal/drupal-apache.conf michael@529: michael@529: %stop -u @l_susr@ michael@529: rcService drupal enable yes || exit 0 michael@529: rcService drupal active no && exit 0 michael@529: [ -f @l_prefix@/var/drupal/run/apache.pid ] && \ michael@529: kill -TERM `cat @l_prefix@/var/drupal/run/apache.pid` michael@529: sleep 2 michael@529: michael@529: %restart -u @l_susr@ michael@529: rcService drupal enable yes || exit 0 michael@529: rcService drupal active no && exit 0 michael@529: rc drupal stop start michael@529: michael@529: %quarterly -u @l_rusr@ michael@529: rcService drupal enable yes || exit 0 michael@529: if [ ".$drupal_cron" = .yes ]; then michael@529: @l_prefix@/sbin/drupal-cron michael@529: fi michael@529: michael@529: %hourly -u @l_rusr@ michael@529: rcService drupal enable yes || exit 0 michael@529: if [ ".$drupal_backup" = .hourly ]; then michael@529: @l_prefix@/sbin/drupal-setup backup || exit $? michael@529: fi michael@529: michael@529: %daily -u @l_rusr@ michael@529: rcService drupal enable yes || exit 0 michael@529: if [ ".$drupal_backup" = .daily ]; then michael@529: @l_prefix@/sbin/drupal-setup backup || exit $? michael@529: fi michael@529: michael@529: %weekly -u @l_rusr@ michael@529: rcService drupal enable yes || exit 0 michael@529: if [ ".$drupal_backup" = .weekly ]; then michael@529: @l_prefix@/sbin/drupal-setup backup || exit $? michael@529: fi michael@529: