]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
avoid shift() error when program called with no actions in _upstart_controlled; tabs
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 19 Aug 2011 19:42:48 +0000 (19:42 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Fri, 19 Aug 2011 19:42:48 +0000 (19:42 +0000)
svn-id: @12328

rc.d/init.d/functions

index 332fc0463e5e16a7827efc8c66cb56342ac852e8..aa68e5dc286d20c3311555e21aed68f346611470 100644 (file)
@@ -1268,7 +1268,7 @@ upstart_reload() {
 upstart_status() {
        # get service status
        # should be compliant with
-        # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
+    # http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
        local service=$1
        local status
        if is_upstart_task "${service}" ; then
@@ -1291,16 +1291,16 @@ upstart_status() {
        # TODO: other statuses
 }
 
-_upstart_controlled () {
+_upstart_controlled() {
        # If the service is to be handled by upstart
        # execute the start/stop/etc. commands the upstart way
-       if ! use_upstart ; then
+       if ! use_upstart; then
                return 0
-       fi      
+       fi
        local script=$1
        shift
        local command=$1
-       shift
+       [ $# -gt 0 ] && shift
        local name=$(basename "$script")
        if [ ! -f /etc/init/${name}.conf ] ; then
                return 0
@@ -1401,7 +1401,7 @@ _upstart_controlled () {
                        fi
                        ;;
                *)
-                       msg_usage "$0 {start|stop|restart|reload|force-reload|status$extra_commands}"
+                       msg_usage "$0 {start|stop|restart|reload|force-reload|status$extra_commands}"
                        exit 3
                        ;;
        esac
This page took 0.876417 seconds and 4 git commands to generate.