i2prouter: add initscript support to Slackware

This commit is contained in:
kytv
2012-10-10 22:44:42 +00:00
parent f20d906b67
commit 1f98493dbd

View File

@@ -1245,6 +1245,19 @@ installdaemon() {
/sbin/chkconfig "$APP_NAME" on /sbin/chkconfig "$APP_NAME" on
fi fi
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 elif [ -f /etc/arch-release ]; then
eval echo `gettext 'Detected Arch Linux:'` eval echo `gettext 'Detected Arch Linux:'`
if [ -f "/etc/rc.d/i2prouter" -o -f "/usr/lib/systemd/system/i2prouter.service" ]; then 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.'` eval echo `gettext ' The $APP_LONG_NAME daemon is not currently installed.'`
exit 1 exit 1
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 ' 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 elif [ -f /etc/arch-release ] ; then
eval echo `gettext 'Detected Arch Linux:'` eval echo `gettext 'Detected Arch Linux:'`
if [ -f "/etc/rc.d/$APP_NAME" -o -f "$SYSTEMD_SERVICE" ] ; then if [ -f "/etc/rc.d/$APP_NAME" -o -f "$SYSTEMD_SERVICE" ] ; then
@@ -1854,6 +1876,7 @@ docommand() {
if [ ! `grep ^RUN_AS_USER $0` ]; then if [ ! `grep ^RUN_AS_USER $0` ]; then
showsetusermesg showsetusermesg
fi fi
echo
echo "You may want to disable the browser from launching at startup at" echo "You may want to disable the browser from launching at startup at"
echo "http://127.0.0.1:7657/configclients" echo "http://127.0.0.1:7657/configclients"
;; ;;