diff --git a/config/functions b/config/functions index a9b7f53174..b71e1c2107 100644 --- a/config/functions +++ b/config/functions @@ -224,11 +224,13 @@ enable_service () { local target_dir=$INSTALL [ -f "$target_dir/$unit_dir/$unit" ] || exit 1 - [ -z "$target" ] && target=`grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=` - - if [ -n "$target" ]; then - mkdir -p ${target_dir}/$unit_dir/${target}.wants - ln -sf ../${unit} ${target_dir}/$unit_dir/${target}.wants/ + if [ -z "$target" ] ; then + for target in `grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=` ; do + if [ -n "$target" ]; then + mkdir -p ${target_dir}/$unit_dir/${target}.wants + ln -sf ../${unit} ${target_dir}/$unit_dir/${target}.wants/ + fi + done fi }