From eff238e85cfee8f41a1234126098f2de81a64c5e Mon Sep 17 00:00:00 2001 From: kytv <kytv@mail.i2p> Date: Fri, 12 Oct 2012 17:26:03 +0000 Subject: [PATCH] i2prouter: In Slackware, check for existence of /etc/rc.d/rc.i2p when installing as a daemon --- installer/resources/i2prouter | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter index 7dc0dfb83a..d498777955 100644 --- a/installer/resources/i2prouter +++ b/installer/resources/i2prouter @@ -1247,16 +1247,21 @@ installdaemon() { fi elif [ -f /etc/slackware-version ]; then eval echo `gettext 'Detected Slackware Linux:'` - if grep -q ${APP_NAME}router /etc/rc.d/rc.local > /dev/null 2>&1; then - eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + if [ -e "/etc/rc.d/rc.i2p" -o -f "/etc/rc.d/rc.i2p.new" ]; then + echo "Found initscript from I2P Slackpkg. Aborting." >&2 exit 1 else - echo "${REALDIR}/${APP_NAME}router start" >> /etc/rc.d/rc.local - if [ ! -e /etc/rc.d/rc.local_shutdown ]; then - echo "#!/bin/sh" >> /etc/rc.d/rc.local_shutdown + if grep -q ${APP_NAME}router /etc/rc.d/rc.local > /dev/null 2>&1; then + eval echo `gettext ' The $APP_LONG_NAME daemon is already installed.'` + exit 1 + else + echo "${REALDIR}/${APP_NAME}router start" >> /etc/rc.d/rc.local + if [ ! -e /etc/rc.d/rc.local_shutdown ]; then + echo "#!/bin/sh" >> /etc/rc.d/rc.local_shutdown + fi + echo "${REALDIR}/${APP_NAME}router stop" >> /etc/rc.d/rc.local_shutdown + chmod 755 /etc/rc.d/rc.local_shutdown fi - echo "${REALDIR}/${APP_NAME}router stop" >> /etc/rc.d/rc.local_shutdown - chmod 755 /etc/rc.d/rc.local_shutdown fi elif [ -f /etc/arch-release ]; then eval echo `gettext 'Detected Arch Linux:'` -- GitLab