diff --git a/config/functions b/config/functions index 86ac2d34a7..fea494a8e2 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 }