~michael-sheldon/ubuntu-touch-session/fix-1659388

« back to all changes in this revision

Viewing changes to ubuntu-session

  • Committer: Tarmac
  • Author(s): Ricardo Mendoza
  • Date: 2012-10-29 17:28:07 UTC
  • mfrom: (5.1.1 ubuntu-session)
  • Revision ID: tarmac-20121029172807-i3622pcb6zbiz6p5
Fix bug with multiple arguments.

Approved by Sergio Schvezov, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
fi
69
69
 
70
70
while read service; do
71
 
    service_path=( $(echo "$service" | tr "/" " ") )
 
71
    service=( $service )
 
72
    arguments=${service[@]:1}
 
73
    service_path=( $(echo "${service[0]}" | tr "/" " ") )
72
74
    binary=${service_path[${#service_path[@]}-1]}
73
 
    $service &> "$HOME/.ubuntu-session/logs/$binary.log" &
74
 
    pids=("${pids[@]}" "$service $!")
75
 
    echo "Started $service with pid $!"
 
75
    ${service[0]} $arguments &> "$HOME/.ubuntu-session/logs/$binary.log" &
 
76
    pids=("${pids[@]}" "${service[0]} $!")
 
77
    echo "Started ${service[0]} with pid $!"
76
78
done < "$services"
77
79
 
78
80
trap 'on_stop' TERM