From Ratler, 8 Years ago, written in Diff-output.
Embed
  1. diff --git a/system/systemd/plugin.d/systemd.plugin b/system/systemd/plugin.d/systemd.plugin
  2. index bda5f68..3582635 100644
  3. --- a/system/systemd/plugin.d/systemd.plugin
  4. +++ b/system/systemd/plugin.d/systemd.plugin
  5. @@ -13,16 +13,19 @@
  6.  
  7.  plugin_systemd_configure()
  8.  {
  9. -  local SERVICES SERVICE_FLAGGED SERVICE SYSTEMD_SERVICES
  10. +  local SERVICES SERVICE_FLAGGED SERVICE SYSTEMD_SERVICES DESC
  11.    debug_msg "plugin_systemd_configure ($@)"
  12.  
  13.    SYSTEMD_SERVICES=$(get_module_config SYSTEMD_SERVICES)
  14.  
  15.    if [ -d $SCRIPT_DIRECTORY/systemd.d ]; then
  16.      cd $SCRIPT_DIRECTORY/systemd.d
  17. -
  18.      SERVICES=$(ls -1)
  19. +  elif [ -f $SCRIPT_DIRECTORY/systemd_services ]; then
  20. +    SERVICES=$(grep ':' $SCRIPT_DIRECTORY/systemd_services | awk -F': ' '{ print $1 }')
  21. +  fi
  22.  
  23. +  if [ -n "$SERVICES" ]; then
  24.      for SERVICE in $SERVICES; do
  25.        # don't ask for '@' services - these should always be installed but
  26.        # never linked directly. Also ask for new or renamed services.
  27. @@ -34,7 +37,12 @@ plugin_systemd_configure()
  28.               fi
  29.          continue
  30.        fi
  31. -      message "${MESSAGE_COLOR}$SERVICE: $(grep Description= $SERVICE | cut -d= -f2-)${DEFAULT_COLOR}"
  32. +      if [ -f $SERVICE ]; then
  33. +        DESC=$(grep Description= $SERVICE | cut -d= -f2-)
  34. +      else
  35. +        DESC=$(grep "^$SERVICE:" $SCRIPT_DIRECTORY/systemd_services | awk -F': ' '{ print $2 }')
  36. +      fi
  37. +      message "${MESSAGE_COLOR}$SERVICE: $DESC${DEFAULT_COLOR}"
  38.        if query "Invoke $SERVICE via systemd automatically at boot ?"  y
  39.        then
  40.          SYSTEMD_SERVICES+=" $SERVICE"
  41.