diff options
Diffstat (limited to 'add-service')
-rwxr-xr-x | add-service | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/add-service b/add-service index 94cc21d..2fc6bc5 100755 --- a/add-service +++ b/add-service @@ -71,10 +71,14 @@ else # if the service is activated, add it again to be able to handle # changes in start/stop levels - if [ -f /etc/rc3.d/S??$srv ]; then + set -- /etc/rc3.d/S??$srv + if [ $# -gt 1 ]; then + echo 1>&2 "add-service: Error: $srv appears multiple times: $*" + fi + if [ -f "$1" ]; then /sbin/chkconfig --add $srv fi - + # restart the service if already running if [ -f /var/lock/subsys/$srv ]; then /sbin/service $srv restart > /dev/null 2>/dev/null || : |