From 1f98493dbdfbd23c2c44839888ad5a56bd9ede15 Mon Sep 17 00:00:00 2001 From: kytv <kytv@mail.i2p> Date: Wed, 10 Oct 2012 22:44:42 +0000 Subject: [PATCH] i2prouter: add initscript support to Slackware --- installer/resources/i2prouter | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter index f9f40450e0..7dc0dfb83a 100644 --- a/installer/resources/i2prouter +++ b/installer/resources/i2prouter @@ -1245,6 +1245,19 @@ installdaemon() { /sbin/chkconfig "$APP_NAME" on fi 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.'` + 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 elif [ -f /etc/arch-release ]; then eval echo `gettext 'Detected Arch Linux:'` if [ -f "/etc/rc.d/i2prouter" -o -f "/usr/lib/systemd/system/i2prouter.service" ]; then @@ -1519,6 +1532,15 @@ removedaemon() { eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` exit 1 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 ' Removing $APP_LONG_NAME daemon...'` + sed -i "/i2prouter/d" /etc/rc.d/rc.local /etc/rc.d/rc.local_shutdown + else + eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'` + exit 1 + fi elif [ -f /etc/arch-release ] ; then eval echo `gettext 'Detected Arch Linux:'` if [ -f "/etc/rc.d/$APP_NAME" -o -f "$SYSTEMD_SERVICE" ] ; then @@ -1854,6 +1876,7 @@ docommand() { if [ ! `grep ^RUN_AS_USER $0` ]; then showsetusermesg fi + echo echo "You may want to disable the browser from launching at startup at" echo "http://127.0.0.1:7657/configclients" ;; -- GitLab