[PC-BSD Commits] r3880 - in pcbsd: trunk/system-overlay/PCBSD/Services/acpinotebook trunk/system-overlay/PCBSD/Services/cups trunk/system-overlay/PCBSD/Services/denyhosts trunk/system-overlay/PCBSD/Services/pf trunk/system-overlay/PCBSD/Services/ssh trunk-current/system-overlay/PCBSD/Services/acpinotebook trunk-current/system-overlay/PCBSD/Services/cups trunk-current/system-overlay/PCBSD/Services/denyhosts trunk-current/system-overlay/PCBSD/Services/pf trunk-current/system-overlay/PCBSD/Services/ssh

svn at pcbsd.org svn at pcbsd.org
Fri May 8 07:35:21 PDT 2009


Author: kris
Date: 2009-05-08 07:35:19 -0700 (Fri, 08 May 2009)
New Revision: 3880

Modified:
   pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/service.cfg
   pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/restart.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/start.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/stop.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/restart.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/start.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/stop.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/restart.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/start.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/stop.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/restart.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/start.sh
   pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/stop.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/service.cfg
   pcbsd/trunk/system-overlay/PCBSD/Services/cups/restart.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/cups/start.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/cups/stop.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/restart.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/start.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/stop.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/pf/restart.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/pf/start.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/pf/stop.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/ssh/restart.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/ssh/start.sh
   pcbsd/trunk/system-overlay/PCBSD/Services/ssh/stop.sh
Log:

Fixed a bug starting services when they are not enabled in rc.conf.

Fixes Trac Bug #165

https://trac.pcbsd.org/ticket/165



Modified: pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,4 +1,5 @@
 #!/bin/sh
 
 SELECTED_ACPI=""
-INITED_ACPI=""
+INITED_ACPI="TRUE"
+

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/service.cfg
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/service.cfg	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/acpinotebook/service.cfg	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,3 +2,13 @@
 name: acpi notebook module
 description: Enables the proper acpi notebook kernel module, so Fn-buttons start working
 
+
+disableStart: YES
+disableStop: YES
+disableRestart: YES
+
+
+disableStart: YES
+disableStop: YES
+disableRestart: YES
+

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/cups/restart.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/cups/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/cups/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,10 +2,29 @@
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/cups/start.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/cups/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/cups/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,11 +2,29 @@
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/cups/stop.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/cups/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/cups/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,11 +2,29 @@
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/restart.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,29 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/start.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/stop.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/denyhosts/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/pf/restart.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/pf/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/pf/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,30 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi
+

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/pf/start.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/pf/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/pf/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,10 +1,28 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/pf/stop.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/pf/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/pf/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,10 +1,28 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/ssh/restart.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/ssh/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/ssh/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,29 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/ssh/start.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/ssh/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/ssh/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk/system-overlay/PCBSD/Services/ssh/stop.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Services/ssh/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk/system-overlay/PCBSD/Services/ssh/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/selected-acpi.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,4 +1,5 @@
 #!/bin/sh
 
 SELECTED_ACPI=""
-INITED_ACPI=""
+INITED_ACPI="TRUE"
+

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/service.cfg
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/service.cfg	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/acpinotebook/service.cfg	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,3 +2,13 @@
 name: acpi notebook module
 description: Enables the proper acpi notebook kernel module, so Fn-buttons start working
 
+
+disableStart: YES
+disableStop: YES
+disableRestart: YES
+
+
+disableStart: YES
+disableStop: YES
+disableRestart: YES
+

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/restart.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,10 +2,29 @@
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/start.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,11 +2,29 @@
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/stop.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/cups/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -2,11 +2,29 @@
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
 
+ENABLED="YES"
+
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^cupsd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/cupsd stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/restart.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,29 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/start.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/stop.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/denyhosts/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^denyhosts_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /PCBSD/local/etc/rc.d/denyhosts.sh stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/restart.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,30 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi
+

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/start.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,10 +1,28 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/stop.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/pf/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,10 +1,28 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^pf_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/pf stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/restart.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/restart.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/restart.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,11 +1,29 @@
 #!/bin/sh
 # This script restarts a currently running service
 # Return a "0" on success, or a "1" on failure
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd restart
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
-  exit 0
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
+ return 0
 else
-  exit 1
+ return 1
 fi

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/start.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/start.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/start.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script starts a stopped service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd start
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-

Modified: pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/stop.sh
===================================================================
--- pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/stop.sh	2009-05-08 13:21:59 UTC (rev 3879)
+++ pcbsd/trunk-current/system-overlay/PCBSD/Services/ssh/stop.sh	2009-05-08 14:35:19 UTC (rev 3880)
@@ -1,12 +1,29 @@
 #!/bin/sh
 # This script stops a started service
 # Return 0 on success, or "1" on failure 
+ENABLED="YES"
 
+DIR=`dirname $0`
+# Check if this service is in /etc/rc.conf
+grep '^sshd_enable="YES"' /etc/rc.conf 
+if [ "$?" != "0" ]
+then
+  ENABLED="NO"
+  ${DIR}/enable.sh
+fi
+
 /etc/rc.d/sshd stop
-if [ "$?" = "0" ]
+ERR=$?
+
+if [ "${ENABLED}" = "NO" ]
 then
+  ${DIR}/disable.sh
+fi
+
+
+if [ "$ERR" = "0" ]
+then
  return 0
 else
  return 1
 fi
-



More information about the Commits mailing list