Changeset 7111

Show
Ignore:
Timestamp:
06/01/11 12:56:38 (2 years ago)
Author:
soma
Message:

libs/core: Allow the use of commands with arguments or of multiple commands for exec in /etc/config/ucitrack

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/core/root/sbin/luci-reload

    r6271 r7111  
    1414 
    1515reload_exec() { 
    16     [ -x $2 ] && { 
    17         echo "Reloading $1... " 
    18         $2 >/dev/null 2>&1 
    19         [ -n "$3" -a "$?" != "$3" ] && echo '!!! Failed to reload' $1 '!!!' 
     16    local service="$1" 
     17    local ok="$3" 
     18    set -- $2 
     19    local cmd="$1"; shift 
     20     
     21    [ -x "$cmd" ] && { 
     22        echo "Reloading $service... " 
     23        ( $cmd "$@" ) 2>/dev/null 1>&2 
     24        [ -n "$ok" -a "$?" != "$ok" ] && echo '!!! Failed to reload' $service '!!!' 
    2025    } 
    2126}