aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service6
1 files changed, 3 insertions, 3 deletions
diff --git a/add-service b/add-service
index f30b81e..d04b4e5 100755
--- a/add-service
+++ b/add-service
@@ -78,7 +78,7 @@ find_unit() {
# If only a sysvinit service is given, then deal with a systemd unit of the same
# name. Specific specs can enable specific unit names as needed but this should
# catch the most common usage.
-if [ -z "$units" ]; then
+if [ -z "$units" -a -n "$srv" -a ! -f /etc/xinetd.d/$srv ]; then
units="$srv.service"
searchunit=$(find_unit $units)
if [ -n "$searchunit" ]; then
@@ -114,7 +114,7 @@ add_service() {
else
srv=
fi
- else
+ elif [ -n "$units" ]; then
for i in $units; do
[ $i != ${i%.service} ] && ! fgrep -qx ${i%.service} $LIST && continue
[ $i != ${i%.socket} ] && ! fgrep -qx ${i%.socket} $LIST && continue
@@ -146,7 +146,7 @@ add_service() {
# In order to enable switching back ot sysvinit, we should enable the
# sysvinit scripts too.
if [ -n "$srv" ]; then
- if [ -f /etc/rc.d/init.d/$srv -o -f /etc/xinet.d/$srv ]; then
+ if [ -f /etc/rc.d/init.d/$srv -o -f /etc/xinetd.d/$srv ]; then
/sbin/chkconfig --add $srv
if [ -r /etc/sysconfig/system ]; then