diff options
author | 2001-09-01 07:27:11 +0000 | |
---|---|---|
committer | 2001-09-01 07:27:11 +0000 | |
commit | ebc3afe745334a25ac33d2564add3592920fa64b (patch) | |
tree | 63de96a1e74c87ed50f2708a06671cef510abf3d /sys-apps/xinetd/files | |
parent | typo (diff) | |
download | historical-ebc3afe745334a25ac33d2564add3592920fa64b.tar.gz historical-ebc3afe745334a25ac33d2564add3592920fa64b.tar.bz2 historical-ebc3afe745334a25ac33d2564add3592920fa64b.zip |
script cleanin
Diffstat (limited to 'sys-apps/xinetd/files')
-rwxr-xr-x | sys-apps/xinetd/files/svc-xinetd | 31 | ||||
-rw-r--r-- | sys-apps/xinetd/files/xinetd.rc5 | 23 |
2 files changed, 22 insertions, 32 deletions
diff --git a/sys-apps/xinetd/files/svc-xinetd b/sys-apps/xinetd/files/svc-xinetd index 4b0d40970012..a8123b64e8fb 100755 --- a/sys-apps/xinetd/files/svc-xinetd +++ b/sys-apps/xinetd/files/svc-xinetd @@ -6,32 +6,28 @@ SERVICE=xinetd opts="start stop" -prepconfig() { +autoconfig() { if [ ! -e /etc/xinetd.conf ] ; then - einfo "Creating new config from inetd..." - /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf - fi - if [ /etc/inetd.conf -nt /etc/xinetd.conf ] ; then - einfo "Creating new config from inetd..." - /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf - fi - if [ ! -e /etc/xinetd.conf ] - then - eerror "xinetd not started. Config file not found." - exit 1 + if [ ! -e /etc/inetd.conf ] ; then + eerror "You need an /etc/xinetd.conf file to run xinetd!" + exit 1 + else + einfo "Auto-creating xinetd.conf from your inetd.conf.." + /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf + fi fi } start() { - prepconfig - ebegin "Starting supervised ${SERVICE}" + autoconfig + ebegin "Starting supervised ${SERVICE}" ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE} - eend $? + eend $? } stop() { - ebegin "Stopping supervised ${SERVICE}" - if [ -e ${SVCDIR}/control/${SERVICE} ] + ebegin "Stopping supervised ${SERVICE}" + if [ -e ${SVCDIR}/control/${SERVICE} ] then /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE} rm ${SVCDIR}/control/${SERVICE} @@ -40,4 +36,3 @@ stop() { } doservice ${@} - diff --git a/sys-apps/xinetd/files/xinetd.rc5 b/sys-apps/xinetd/files/xinetd.rc5 index f8fbf94aeaa6..8e04dba33cf2 100644 --- a/sys-apps/xinetd/files/xinetd.rc5 +++ b/sys-apps/xinetd/files/xinetd.rc5 @@ -7,24 +7,20 @@ SERVICE=xinetd EXE="/usr/sbin/xinetd" opts="start stop" -prepconfig() { +autoconfig() { if [ ! -e /etc/xinetd.conf ] ; then - einfo "Creating new config from inetd..." - /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf - fi - if [ /etc/inetd.conf -nt /etc/xinetd.conf ] ; then - einfo "Creating new config from inetd..." - /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf - fi - if [ ! -e /etc/xinetd.conf ] - then - eerror "Xinetd not started. Config file not found." - exit 1 + if [ ! -e /etc/inetd.conf ] ; then + eerror "You need an /etc/xinetd.conf file to run xinetd!" + exit 1 + else + einfo "Auto-creating xinetd.conf from your inetd.conf.." + /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf + fi fi } start() { - prepconfig + autoconfig ebegin "Starting ${SERVICE}" start-stop-daemon --start --quiet --exec $EXE 1>&2 eend $? @@ -37,4 +33,3 @@ stop() { } doservice ${@} - |