2010-01-26 15:21:41 +00:00
#!/bin/sh
2004-08-19 04:48:42 +00:00
#
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Copyright (c) 1999, 2011 Tanuki Software, Ltd.
# http://www.tanukisoftware.com
# All rights reserved.
2004-08-19 04:48:42 +00:00
#
# Make sure that PIDFILE points to the correct location,
# if you have changed the default location set in the
# wrapper configuration file.
#
2010-02-15 12:43:28 +00:00
# If this script fails to successfully invoke i2psvc on your platform,
2009-10-26 14:18:57 +00:00
# try the runplain.sh script instead.
#
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# This software is the proprietary information of Tanuki Software.
# You shall use it only in accordance with the terms of the
# license agreement you entered into with Tanuki Software.
# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
#
# Java Service Wrapper sh script. Suitable for starting and stopping
# wrapped Java applications on UNIX platforms.
#
2004-08-19 04:48:42 +00:00
#-----------------------------------------------------------------------------
# These settings can be modified to fit the needs of your application
2013-11-15 01:02:37 +00:00
# Optimized for use with version 3.5.22 of the Wrapper.
2004-08-19 04:48:42 +00:00
2009-06-13 21:04:27 +00:00
# Paths
2012-08-04 17:32:11 +00:00
# Note that (percent)INSTALL_PATH, (percent)USER_HOME, and (percent)SYSTEM_java_io_tmpdir
2009-06-13 21:04:27 +00:00
# should have been replaced by the izpack installer.
2012-08-04 17:32:11 +00:00
# If you did not run the installer, replace them with the appropriate paths.
2009-06-13 21:04:27 +00:00
I2P="%INSTALL_PATH"
2013-08-08 12:07:16 +00:00
if [ "`uname -s`" = "Darwin" ]; then
2013-04-29 16:54:36 +00:00
if [ -d "%USER_HOME/Library/Application Support" ]; then
I2P_CONFIG_DIR="%USER_HOME/Library/Application Support/i2p"
else
I2P_CONFIG_DIR="%USER_HOME/.i2p"
fi
else
I2P_CONFIG_DIR="%USER_HOME/.i2p"
fi
2009-06-13 21:04:27 +00:00
I2PTEMP="%SYSTEM_java_io_tmpdir"
2009-07-26 14:55:01 +00:00
# PORTABLE installation:
# Use the following instead.
#I2PTEMP="%INSTALL_PATH"
2009-06-13 21:04:27 +00:00
2004-08-19 04:48:42 +00:00
# Application
APP_NAME="i2p"
APP_LONG_NAME="I2P Service"
2012-01-14 02:28:10 +00:00
# gettext - we look for it in the path
2012-01-13 22:26:35 +00:00
# fallback to echo is below, we can't set it to echo here.
2012-02-10 19:44:12 +00:00
GETTEXT=$(which gettext > /dev/null 2>&1)
2012-01-13 22:26:35 +00:00
2012-10-10 21:33:05 +00:00
# Where to install the systemd service
SYSTEMD_SERVICE="/etc/systemd/system/${APP_NAME}.service"
2012-10-30 19:41:35 +00:00
if grep -q systemd /proc/1/comm > /dev/null 2>&1 ; then
2012-10-10 21:33:05 +00:00
USE_SYSTEMD=1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# If specified, the Wrapper will be run as the specified user.
# IMPORTANT - Make sure that the user has the required privileges to write
2012-02-04 13:11:54 +00:00
# the PID file and wrapper.log files and that the directories exist.
# Failure to write the pid file will cause the Wrapper to exit.
# Failure to write the log file will cause the Wrapper to use CWD for the log file location.
#
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# NOTE - This will set the user which is used to run the Wrapper as well as
# the JVM and is not useful in situations where a privileged resource or
# port needs to be allocated prior to the user being changed.
#RUN_AS_USER=
2004-08-19 04:48:42 +00:00
# Wrapper
2009-06-13 21:04:27 +00:00
WRAPPER_CMD="$I2P/i2psvc"
WRAPPER_CONF="$I2P/wrapper.config"
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Priority at which to run the wrapper. See "man nice" for valid priorities.
# nice is only used if a priority is specified.
PRIORITY=
2012-02-04 13:11:54 +00:00
# Location of the pid and status files.
PIDDIR="$I2P_CONFIG_DIR"
#PIDDIR="$I2PTEMP"
# Location of the wrapper.log file
LOGDIR="$I2P_CONFIG_DIR"
#LOGDIR="$I2PTEMP"
LOGFILE="$LOGDIR/wrapper.log"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
2011-09-13 01:16:12 +00:00
# If you'd like to run I2P as root (not recommended), uncomment the
# following line
#ALLOW_ROOT=true
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# FIXED_COMMAND tells the script to use a hard coded action rather than
# expecting the first parameter of the command line to be the command.
# By default the command will will be expected to be the first parameter.
#FIXED_COMMAND=console
# PASS_THROUGH tells the script to pass all arguments through to the JVM
# as is. If FIXED_COMMAND is specified then all arguments will be passed.
# If not set then all arguments starting with the second will be passed.
#PASS_THROUGH=true
# If uncommented, causes the Wrapper to be shutdown using an anchor file.
# When launched with the 'start' command, it will also ignore all INT and
# TERM signals.
#IGNORE_SIGNALS=true
# Wrapper will start the JVM asynchronously. Your application may have some
# initialization tasks and it may be desirable to wait a few seconds
# before returning. For example, to delay the invocation of following
# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will
# cause the start command to delay for the indicated period of time
# (in seconds).
#
WAIT_AFTER_STARTUP=0
# If set, wait for the wrapper to report that the daemon has started
WAIT_FOR_STARTED_STATUS=true
WAIT_FOR_STARTED_TIMEOUT=120
# If set, the status, start_msg and stop_msg commands will print out detailed
# state information on the Wrapper and Java processes.
#DETAIL_STATUS=true
# By default we show a detailed usage block. Uncomment to show brief usage.
#BRIEF_USAGE=true
# flag for using upstart when installing (rather than init.d rc.d)
USE_UPSTART=
2011-12-19 18:14:21 +00:00
# Source the environment variables for the locale if $LANG isn't set
# If you want to set custom locale variables for I2P,
# you may comment out this block and set them yourself here.
if [ ! -n $LANG ]; then
for ENV_FILE in /etc/environment /etc/default/locale; do
[ -r "$ENV_FILE" ] || continue
[ -s "$ENV_FILE" ] || continue
for var in LANG LANGUAGE LC_ALL LC_CTYPE; do
value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2`
[ -n "$value" ] && eval export $var=$value
done
done
fi
2015-01-03 01:51:32 +00:00
# Mac OSX 10.10 requires the parameter bellow to run without a icon in the Dock.
if [ "`uname -s`" = "Darwin" ]; then
export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# When installing on On Mac OSX platforms, the following domain will be used to
# prefix the plist file name.
PLIST_DOMAIN=org.tanukisoftware.wrapper
# The following two lines are used by the chkconfig command. Change as is
# appropriate for your application. They should remain commented.
# chkconfig: 2345 20 80
# description: I2P Service
# Initialization block for the install_initd and remove_initd scripts used by
# SUSE linux distributions.
### BEGIN INIT INFO
# Provides: i2p
# Required-Start: $local_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: I2P Service
# Description: I2P is a load-balanced unspoofable packet switching network
### END INIT INFO
# Do not modify anything beyond this point
#-----------------------------------------------------------------------------
2012-01-28 22:10:33 +00:00
if [ ! -e "$WRAPPER_CONF" ]; then
2011-11-09 18:30:21 +00:00
echo "Starting I2P Failed: Unable to find $WRAPPER_CONF"
exit 1
fi
2011-11-02 00:05:51 +00:00
# Workaround for Gentoo
2012-01-28 22:10:33 +00:00
JAVABINARY=$(awk -F'=' '/^ *wrapper\.java\.command/{print $2}' "$WRAPPER_CONF")
2011-11-02 00:05:51 +00:00
if [ -e /etc/gentoo-release ]; then
if [ $JAVABINARY = java ]; then
if [ -x /etc/java-config-2/current-system-vm/bin/java ]; then
JAVABINARY="/etc/java-config-2/current-system-vm/bin/java"
else
2011-11-09 18:30:21 +00:00
echo "Please set wrapper.java.command in $WRAPPER_CONF"
2011-11-02 00:05:51 +00:00
exit 1
fi
fi
fi
2014-08-04 15:49:46 +00:00
WRAPPER_URL="https://geti2p.net/en/misc/manual-wrapper"
2011-06-21 22:45:21 +00:00
unsupported() {
echo "The most likely reason is that a supported version of the java"
echo "wrapper is not available in the I2P installation package for your"
echo "platform. It may be possible to manually download and install"
echo "a compatible wrapper for your system."
echo "See ${WRAPPER_URL} for hints."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo
2011-06-21 22:45:21 +00:00
echo "In the meantime, you may start I2P by running the script"
echo "${I2P}/runplain.sh"
echo
}
2014-02-11 01:54:45 +00:00
freebsd10() {
echo
2016-05-04 13:40:50 +00:00
echo "The current version of the Tanuki wrapper that is bundled"
echo "with I2P does not support FreeBSD 10."
2014-02-11 01:54:45 +00:00
echo
2016-05-04 13:40:50 +00:00
echo "See http://trac.i2p2.de/ticket/1118#comment:13 for a work-around."
echo "After applying the work-around, as a normal user or a dedicated"
echo "i2p user, you can then run:"
echo "$ ./i2prouter start"
2014-02-11 01:54:45 +00:00
echo
2016-05-04 13:40:50 +00:00
echo "Or, you may also start I2P by running the script:"
2014-02-11 01:54:45 +00:00
echo "${I2P}/runplain.sh"
echo
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
failed() {
2014-02-11 01:54:45 +00:00
echo "**`gettext 'Failed to load the wrapper'`**"
case `uname -s` in
FreeBSD)
case `uname -r` in
10*|11*)
freebsd10
;;
*)
# We should never get here on recent versions of FreeBSD
2016-05-04 13:40:50 +00:00
if ! $(pkg info -E 'libiconv*' > /dev/null 2>&1); then
2014-02-11 01:54:45 +00:00
echo
echo "The wrapper requires libiconv."
echo
2016-05-04 13:40:50 +00:00
echo "It can be installed with pkg install libiconv"
2014-02-11 01:54:45 +00:00
echo
fi
;;
esac
;;
*)
echo
unsupported
;;
esac
exit 1
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
}
if [ -n "$FIXED_COMMAND" ]
then
COMMAND="$FIXED_COMMAND"
else
COMMAND="$1"
fi
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Required for HP-UX Startup
if [ `uname -s` = "HP-UX" -o `uname -s` = "HP-UX64" ] ; then
PATH=$PATH:/usr/bin
fi
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Get the fully qualified path to the script
case $0 in
/*)
SCRIPT="$0"
;;
*)
PWD=`pwd`
SCRIPT="$PWD/$0"
;;
esac
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Resolve the true real path without any sym links.
CHANGED=true
while [ "X$CHANGED" != "X" ]
do
# Change spaces to ":" so the tokens can be parsed.
SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
# Get the real path to this script, resolving any symbolic links
TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'`
REALPATH=
for C in $TOKENS; do
# Change any ":" in the token back to a space.
C=`echo $C | sed -e 's;:; ;g'`
REALPATH="$REALPATH/$C"
# If REALPATH is a sym link, resolve it. Loop for nested links.
while [ -h "$REALPATH" ] ; do
LS="`ls -ld "$REALPATH"`"
LINK="`expr "$LS" : '.*-> \(.*\)$'`"
if expr "$LINK" : '/.*' > /dev/null; then
# LINK is absolute.
REALPATH="$LINK"
else
# LINK is relative.
REALPATH="`dirname "$REALPATH"`""/$LINK"
fi
done
done
if [ "$REALPATH" = "$SCRIPT" ]
then
CHANGED=""
else
SCRIPT="$REALPATH"
fi
done
# Get the location of the script.
REALDIR=`dirname "$REALPATH"`
# Normalize the path
2011-09-30 16:02:02 +00:00
REALDIR=`cd "${REALDIR}"; pwd`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if
# the working directory is later changed.
FIRST_CHAR=`echo $PIDDIR | cut -c1,1`
if [ "$FIRST_CHAR" != "/" ]
then
PIDDIR=$REALDIR/$PIDDIR
fi
# Same test for WRAPPER_CMD
FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1`
if [ "$FIRST_CHAR" != "/" ]
then
WRAPPER_CMD=$REALDIR/$WRAPPER_CMD
fi
# Same test for WRAPPER_CONF
FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1`
if [ "$FIRST_CHAR" != "/" ]
then
WRAPPER_CONF=$REALDIR/$WRAPPER_CONF
fi
2004-08-19 04:48:42 +00:00
# Process ID
ANCHORFILE="$PIDDIR/$APP_NAME.anchor"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
COMMANDFILE="$PIDDIR/$APP_NAME.command"
STATUSFILE="$PIDDIR/$APP_NAME.status"
JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status"
2012-02-08 15:21:43 +00:00
PIDFILE="$PIDDIR/$APP_NAME.pid"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
LOCKDIR="/var/lock/subsys"
LOCKFILE="$LOCKDIR/$APP_NAME"
2004-08-19 04:48:42 +00:00
pid=""
# Resolve the location of the 'ps' command
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
PSEXE="/usr/ucb/ps"
if [ ! -x "$PSEXE" ]
then
PSEXE="/usr/bin/ps"
if [ ! -x "$PSEXE" ]
then
PSEXE="/bin/ps"
if [ ! -x "$PSEXE" ]
then
2012-12-22 15:10:57 +00:00
echo 'Unable to locate "ps".'
echo 'Please report this message along with the location of the command on your system.'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
fi
fi
2011-09-30 16:02:02 +00:00
TREXE="/usr/bin/tr"
if [ ! -x "$TREXE" ]
then
TREXE="/bin/tr"
if [ ! -x "$TREXE" ]
then
2012-12-22 15:10:57 +00:00
echo 'Unable to locate "tr".'
echo 'Please report this message along with the location of the command on your system.'
2011-09-30 16:02:02 +00:00
exit 1
fi
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Resolve the os
2011-09-30 16:02:02 +00:00
DIST_OS=`uname -s | $TREXE "[A-Z]" "[a-z]" | $TREXE -d ' '`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
case "$DIST_OS" in
'sunos')
DIST_OS="solaris"
;;
'hp-ux' | 'hp-ux64')
# HP-UX needs the XPG4 version of ps (for -o args)
DIST_OS="hpux"
UNIX95=""
export UNIX95
;;
'darwin')
DIST_OS="macosx"
;;
'unix_sv')
DIST_OS="unixware"
;;
2012-11-19 22:41:54 +00:00
'gnu/kfreebsd')
DIST_OS="kfreebsd"
;;
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
'os/390')
DIST_OS="zos"
;;
esac
# Resolve the architecture
if [ "$DIST_OS" = "macosx" ]
2004-08-19 04:48:42 +00:00
then
2012-08-11 11:40:05 +00:00
OS_VER=`sw_vers | grep ProductVersion | cut -d: -f2 | sed -e 's/[^0-9]*//'`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
DIST_ARCH="universal"
2011-12-31 22:46:49 +00:00
if [ $(sysctl -n hw.cpu64bit_capable) -eq 1 ]; then
DIST_BITS="64"
else
DIST_BITS="32"
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
APP_PLIST_BASE=${PLIST_DOMAIN}.${APP_NAME}
APP_PLIST=${APP_PLIST_BASE}.plist
else
2014-06-13 20:55:36 +00:00
DIST_ARCH=`uname -m 2>/dev/null | $TREXE "[A-Z]" "[a-z]" | $TREXE -d ' '`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
case "$DIST_ARCH" in
'athlon' | 'i386' | 'i486' | 'i586' | 'i686')
DIST_ARCH="x86"
if [ "${DIST_OS}" = "solaris" ] ; then
DIST_BITS=`isainfo -b`
else
DIST_BITS="32"
fi
;;
2014-06-12 00:41:14 +00:00
amdfx* | 'amd64' | 'x86_64')
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
DIST_ARCH="x86"
DIST_BITS="64"
;;
'ia32')
DIST_ARCH="ia"
DIST_BITS="32"
;;
'ia64' | 'ia64n' | 'ia64w')
DIST_ARCH="ia"
DIST_BITS="64"
;;
'ip27')
DIST_ARCH="mips"
DIST_BITS="32"
;;
'power' | 'powerpc' | 'power_pc' | 'ppc64')
if [ "${DIST_ARCH}" = "ppc64" ] ; then
DIST_BITS="64"
else
DIST_BITS="32"
fi
DIST_ARCH="ppc"
if [ "${DIST_OS}" = "aix" ] ; then
if [ `getconf KERNEL_BITMODE` -eq 64 ]; then
DIST_BITS="64"
else
DIST_BITS="32"
fi
fi
;;
'pa_risc' | 'pa-risc')
DIST_ARCH="parisc"
if [ `getconf KERNEL_BITS` -eq 64 ]; then
DIST_BITS="64"
else
DIST_BITS="32"
fi
;;
'sun4u' | 'sparcv9' | 'sparc')
DIST_ARCH="sparc"
DIST_BITS=`isainfo -b`
;;
'9000/800' | '9000/785')
DIST_ARCH="parisc"
if [ `getconf KERNEL_BITS` -eq 64 ]; then
DIST_BITS="64"
else
DIST_BITS="32"
fi
;;
'2064' | '2066' | '2084' | '2086' | '2094' | '2096' | '2097' | '2098' | '2817')
DIST_ARCH="390"
DIST_BITS="64"
;;
2012-12-22 14:57:28 +00:00
armv*)
2014-06-13 20:55:36 +00:00
if [ -z "`readelf -A /proc/self/exe | grep Tag_ABI_VFP_args`" ] ; then
2012-12-22 14:57:28 +00:00
DIST_ARCH="armel"
DIST_BITS="32"
2014-06-13 20:55:36 +00:00
else
2012-12-22 14:57:28 +00:00
DIST_ARCH="armhf"
DIST_BITS="32"
fi
2012-11-21 21:03:55 +00:00
;;
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
esac
fi
2016-05-04 16:05:30 +00:00
# Through Java 6, OSX always places Java in the same location so we can reliably set JAVA_HOME
# As of OSX 10.5 / Java 7, call /usr/libexec/java_home to find it
# https://developer.apple.com/library/mac/qa/qa1170/_index.html
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "$DIST_OS" = "macosx" ]
then
if [ -z "$JAVA_HOME" ]; then
2016-05-04 16:05:30 +00:00
if [ -x "/usr/libexec/java_home" ]; then
JAVA_HOME=`/usr/libexec/java_home`
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME="/Library/Java/Home"
fi
export JAVA_HOME
2004-08-19 04:48:42 +00:00
fi
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Test Echo
ECHOTEST=`echo -n "x"`
if [ "$ECHOTEST" = "x" ]
then
ECHOOPT="-n "
else
ECHOOPT=""
fi
gettext() {
2012-01-13 22:26:35 +00:00
# Call external gettext using our own translation files.
# Don't attempt to translate via the wrapper,
2012-01-09 23:58:24 +00:00
# it probably isn't supported in the community edition.
2012-02-10 19:44:12 +00:00
if [ "X${LANG#en}" = "X$LANG" ] && [ $(which $GETTEXT > /dev/null 2>&1) ] ; then
2012-01-14 02:28:10 +00:00
TEXTDOMAINDIR=$I2P/locale $GETTEXT -d i2prouter "$1"
if [ $? != 0 ] ; then
echo "$1"
fi
else
2012-01-13 22:26:35 +00:00
echo "$1"
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
}
outputFile() {
if [ -f "$1" ]
then
2012-12-22 19:30:36 +00:00
echo " $1 Found but not executable.";
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
echo " $1"
fi
}
2015-05-04 09:22:25 +00:00
setup_openbsd() {
if ! pkg_info -qe 'java-tanukiwrapper->=3.5.19'; then
echo "Java wrapper not found. Either:"
echo "- install the package java-tanukiwrapper then start I2P again; or"
echo "- start I2P with $I2P/runplain.sh"
exit 1
else
# Wrapper package is installed so let's try copying the bits into the proper places
pkg_path=$(pkg_info -v java-tanukiwrapper | awk '/^@cwd/{print $2}')
if [ -z $pkg_path ]; then
# Fallback, but we shouldn't end up here
echo "Unable to locate ${WRAPPER_CMD} in ${I2P}!"
echo
unsupported
exit 1
fi
set -e # abort in case of error
# Package java-tanukiwrapper-3.5.19.1 misspells 'tanuki'
if [ -e "$pkg_path/lib/tanukuwrapper/libwrapper.so" ]; then
2015-05-04 13:47:32 +00:00
ln -sf "$pkg_path/lib/tanukuwrapper/libwrapper.so" "$I2P/lib/libwrapper.so"
2015-05-04 09:22:25 +00:00
else # they fixed the path
2015-05-04 13:47:32 +00:00
ln -sf "$pkg_path/lib/tanukiwrapper/libwrapper.so" "$I2P/lib/libwrapper.so"
2015-05-04 09:22:25 +00:00
fi
2015-05-04 13:47:32 +00:00
ln -sf "$pkg_path/share/java/classes/tanukiwrapper.jar" "$I2P/lib/wrapper.jar"
ln -sf "$pkg_path/sbin/tanukiwrapper" "$WRAPPER_CMD"
2015-05-04 09:22:25 +00:00
fi
set +e
}
2016-01-23 08:28:02 +00:00
if [ "$DIST_OS" = "openbsd" -a ! -f "$WRAPPER_CMD" ]; then
2015-05-04 09:22:25 +00:00
# We handle it here because Tanuki doesn't ship OpenBSD binaries.
# We don't either, but they are (finally!) in OpenBSD itself.
setup_openbsd
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Decide on the wrapper binary to use.
# If the bits of the OS could be detected, we will try to look for the
# binary with the correct bits value. If it doesn't exist, fall back
# and look for the 32-bit binary. If that doesn't exist either then
# look for the default.
WRAPPER_TEST_CMD=""
if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS" ]
then
WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS"
if [ ! -x "$WRAPPER_TEST_CMD" ]
then
chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null
fi
if [ -x "$WRAPPER_TEST_CMD" ]
then
WRAPPER_CMD="$WRAPPER_TEST_CMD"
else
outputFile "$WRAPPER_TEST_CMD"
WRAPPER_TEST_CMD=""
fi
fi
if [ -f "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" -a -z "$WRAPPER_TEST_CMD" ]
then
WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32"
if [ ! -x "$WRAPPER_TEST_CMD" ]
then
chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null
fi
if [ -x "$WRAPPER_TEST_CMD" ]
then
WRAPPER_CMD="$WRAPPER_TEST_CMD"
else
outputFile "$WRAPPER_TEST_CMD"
WRAPPER_TEST_CMD=""
fi
fi
if [ -f "$WRAPPER_CMD" -a -z "$WRAPPER_TEST_CMD" ]
then
WRAPPER_TEST_CMD="$WRAPPER_CMD"
if [ ! -x "$WRAPPER_TEST_CMD" ]
then
chmod +x "$WRAPPER_TEST_CMD" 2>/dev/null
fi
if [ -x "$WRAPPER_TEST_CMD" ]
then
WRAPPER_CMD="$WRAPPER_TEST_CMD"
else
outputFile "$WRAPPER_TEST_CMD"
WRAPPER_TEST_CMD=""
fi
fi
if [ -z "$WRAPPER_TEST_CMD" ]
then
2012-12-22 15:10:57 +00:00
echo 'Unable to locate any of the following binaries:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-$DIST_BITS"
if [ ! "$DIST_BITS" = "32" ]
then
outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32"
fi
outputFile "$WRAPPER_CMD"
exit 1
fi
2012-07-12 22:43:12 +00:00
if [ ! -r "${WRAPPER_CMD}" ]; then
echo "Unable to locate ${WRAPPER_CMD} in ${I2P}!"
echo
unsupported
echo
exit 1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
2014-06-12 00:41:14 +00:00
if $(which ldd > /dev/null 2>&1); then
# This should cover every *NIX other than OSX since OSX doesn't have ldd.
# OSX has otool. Is otool on every OSX installation? Is otool's output the same as ldd's?
# The wrapper we ship for OSX are for PPC and Intel, so maybe we don't need to worry about OSX?
if (ldd "$WRAPPER_CMD" |grep -q 'not found') > /dev/null 2>&1 || \
! (ldd "$WRAPPER_CMD" > /dev/null 2>&1); then
failed
fi
fi
2004-08-19 04:48:42 +00:00
# Build the nice clause
if [ "X$PRIORITY" = "X" ]
then
CMDNICE=""
else
CMDNICE="nice -$PRIORITY"
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Build the anchor file clause.
if [ "X$IGNORE_SIGNALS" = "X" ]
then
ANCHORPROP=
IGNOREPROP=
else
ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\"
IGNOREPROP=wrapper.ignore_signals=TRUE
fi
# Build the status file clause.
if [ "X$DETAIL_STATUS$WAIT_FOR_STARTED_STATUS" = "X" ]
2004-08-19 04:48:42 +00:00
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
STATUSPROP=
else
STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\""
fi
# Build the command file clause.
2012-12-22 15:10:57 +00:00
COMMANDPROP=
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
2012-02-04 13:11:54 +00:00
# Build the log file clause.
LOGPROP="wrapper.logfile=\"$LOGFILE\""
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ ! -n "$WAIT_FOR_STARTED_STATUS" ]
then
WAIT_FOR_STARTED_STATUS=true
fi
if [ $WAIT_FOR_STARTED_STATUS = true ] ; then
DETAIL_STATUS=true
fi
# Build the lock file clause. Only create a lock file if the lock directory exists on this platform.
LOCKPROP=
if [ -d $LOCKDIR ]
then
if [ -w $LOCKDIR ]
2004-08-19 04:48:42 +00:00
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
LOCKPROP=wrapper.lockfile=\"$LOCKFILE\"
2004-08-19 04:48:42 +00:00
fi
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
prepAdditionalParams() {
ADDITIONAL_PARA=""
if [ -n "$PASS_THROUGH" ] ; then
ADDITIONAL_PARA="--"
fi
while [ -n "$1" ] ; do
ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\""
shift
done
}
checkUser() {
# $1 touchLock flag
# $2.. [command] args
# Check the configured user. If necessary rerun this script as the desired user.
if [ "X$RUN_AS_USER" != "X" ]
then
2012-11-21 21:03:55 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Resolve the location of the 'id' command
IDEXE="/usr/xpg4/bin/id"
if [ ! -x "$IDEXE" ]
then
IDEXE="/usr/bin/id"
if [ ! -x "$IDEXE" ]
then
2012-12-22 15:10:57 +00:00
echo 'Unable to locate "id".'
echo 'Please report this message along with the location of the command on your system.'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
fi
2012-11-23 18:08:04 +00:00
if [ "`$IDEXE -u -n "$RUN_AS_USER" 2>/dev/null`" != "$RUN_AS_USER" ]
then
2012-12-22 19:30:36 +00:00
echo "User $RUN_AS_USER does not exist."
2012-11-23 18:08:04 +00:00
exit 1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ]
then
# Already running as the configured user. Avoid password prompts by not calling su.
RUN_AS_USER=""
fi
fi
if [ "X$RUN_AS_USER" != "X" ]
then
# If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be
# able to create the lock file. The Wrapper will be able to update this file once it
# is created but will not be able to delete it on shutdown. If $1 is set then
# the lock file should be created for the current command
if [ "X$LOCKPROP" != "X" ]
then
if [ "X$1" != "X" ]
then
# Resolve the primary group
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
if [ "X$RUN_AS_GROUP" = "X" ]
then
RUN_AS_GROUP=$RUN_AS_USER
fi
touch $LOCKFILE
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
fi
fi
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
shift
# Wrap the parameters so they can be passed.
ADDITIONAL_PARA=""
while [ -n "$1" ] ; do
ADDITIONAL_PARA="$ADDITIONAL_PARA \"$1\""
shift
done
# Use "runuser" if this exists. runuser should be used on RedHat in preference to su.
#
if test -f "/sbin/runuser"
then
2013-05-15 13:04:46 +00:00
/sbin/runuser -s /bin/sh - $RUN_AS_USER -c "\"$REALPATH\" $ADDITIONAL_PARA"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
2013-05-15 13:04:46 +00:00
su - $RUN_AS_USER -s /bin/sh -c "\"$REALPATH\" $ADDITIONAL_PARA"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
RUN_AS_USER_EXITCODE=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
then
getpid
if [ "X$pid" = "X" ]
then
# Wrapper is not running so make sure the lock file is deleted.
if [ -f "$LOCKFILE" ]
then
rm "$LOCKFILE"
fi
fi
fi
exit $RUN_AS_USER_EXITCODE
fi
}
2004-08-19 04:48:42 +00:00
getpid() {
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
pid=""
if [ -f "$PIDFILE" ]
2004-08-19 04:48:42 +00:00
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -r "$PIDFILE" ]
2004-08-19 04:48:42 +00:00
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
pid=`cat "$PIDFILE"`
2004-08-19 04:48:42 +00:00
if [ "X$pid" != "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# It is possible that 'a' process with the pid exists but that it is not the
# correct process. This can happen in a number of cases, but the most
# common is during system startup after an unclean shutdown.
# The ps statement below looks for the specific wrapper command running as
# the pid. If it is not found then the pid file is considered to be stale.
case "$DIST_OS" in
'freebsd')
pidtest=`$PSEXE -p $pid -o args | tail -1`
if [ "X$pidtest" = "XCOMMAND" ]
then
pidtest=""
fi
;;
'macosx')
pidtest=`$PSEXE -ww -p $pid -o command | grep -F "$WRAPPER_CMD" | tail -1`
;;
'solaris')
if [ -f "/usr/bin/pargs" ]
then
pidtest=`pargs $pid | fgrep "$WRAPPER_CMD" | tail -1`
else
case "$PSEXE" in
'/usr/ucb/ps')
pidtest=`$PSEXE -auxww $pid | fgrep "$WRAPPER_CMD" | tail -1`
;;
'/usr/bin/ps')
TRUNCATED_CMD=`$PSEXE -o comm -p $pid | tail -1`
COUNT=`echo $TRUNCATED_CMD | wc -m`
COUNT=`echo ${COUNT}`
COUNT=`expr $COUNT - 1`
TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT`
pidtest=`$PSEXE -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1`
;;
'/bin/ps')
TRUNCATED_CMD=`$PSEXE -o comm -p $pid | tail -1`
COUNT=`echo $TRUNCATED_CMD | wc -m`
COUNT=`echo ${COUNT}`
COUNT=`expr $COUNT - 1`
TRUNCATED_CMD=`echo $WRAPPER_CMD | cut -c1-$COUNT`
pidtest=`$PSEXE -o comm -p $pid | fgrep "$TRUNCATED_CMD" | tail -1`
;;
*)
echo "Unsupported ps command $PSEXE"
exit 1
;;
esac
fi
;;
'hpux')
pidtest=`$PSEXE -p $pid -x -o args | grep -F "$WRAPPER_CMD" | tail -1`
;;
*)
pidtest=`$PSEXE -p $pid -o args | grep -F "$WRAPPER_CMD" | tail -1`
;;
esac
if [ "X$pidtest" = "X" ]
2004-08-19 04:48:42 +00:00
then
# This is a stale pid file.
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
rm -f "$PIDFILE"
2012-12-22 19:30:36 +00:00
echo "Removed stale pid file: $PIDFILE"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
pid=""
2004-08-19 04:48:42 +00:00
fi
fi
else
2012-12-22 19:30:36 +00:00
echo "Cannot read $PIDFILE."
2004-08-19 04:48:42 +00:00
exit 1
fi
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
getstatus() {
STATUS=
if [ -f "$STATUSFILE" ]
then
if [ -r "$STATUSFILE" ]
then
STATUS=`cat "$STATUSFILE"`
fi
fi
if [ "X$STATUS" = "X" ]
then
STATUS="Unknown"
fi
JAVASTATUS=
if [ -f "$JAVASTATUSFILE" ]
then
if [ -r "$JAVASTATUSFILE" ]
then
JAVASTATUS=`cat "$JAVASTATUSFILE"`
fi
fi
if [ "X$JAVASTATUS" = "X" ]
then
JAVASTATUS="Unknown"
fi
}
2004-08-19 04:48:42 +00:00
testpid() {
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
case "$DIST_OS" in
'solaris')
case "$PSEXE" in
'/usr/ucb/ps')
pid=`$PSEXE $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
;;
'/usr/bin/ps')
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
;;
'/bin/ps')
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
;;
*)
echo "Unsupported ps command $PSEXE"
exit 1
;;
esac
;;
*)
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` 2>/dev/null
;;
esac
2004-08-19 04:48:42 +00:00
if [ "X$pid" = "X" ]
then
# Process is gone so remove the pid file.
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
rm -f "$PIDFILE"
pid=""
fi
}
launchdtrap() {
stopit
exit
}
waitforwrapperstop() {
getpid
while [ "X$pid" != "X" ] ; do
sleep 1
getpid
done
}
2013-05-15 13:38:34 +00:00
create_config_dir() {
2013-11-07 19:56:01 +00:00
if [ ! -d "$I2P_CONFIG_DIR" ]; then
UMASK=$(awk -F'=' '/^ *wrapper\.umask/{print $2}' $WRAPPER_CONF)
umask $UMASK
if ! mkdir -p "$I2P_CONFIG_DIR"; then
echo "Error creating $I2P_CONFIG_DIR! Edit $0 and set I2P_CONFIG_DIR" >&2
echo "to the correct location." >&2
exit 1
fi
2013-05-15 13:38:34 +00:00
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
launchdinternal() {
getpid
trap launchdtrap TERM
if [ "X$pid" = "X" ]
then
prepAdditionalParams "$@"
2013-05-15 13:38:34 +00:00
create_config_dir
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# The string passed to eval must handles spaces in paths correctly.
2014-02-11 01:54:45 +00:00
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
eval $COMMAND_LINE || failed
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1
fi
# launchd expects that this script stay up and running so we need to do our own monitoring of the Wrapper process.
if [ $WAIT_FOR_STARTED_STATUS = true ]
then
waitforwrapperstop
2004-08-19 04:48:42 +00:00
fi
}
console() {
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Running $APP_LONG_NAME'`..."
2004-08-19 04:48:42 +00:00
getpid
if [ "X$pid" = "X" ]
then
2011-09-13 00:55:37 +00:00
trap '' 3 2
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
prepAdditionalParams "$@"
2013-05-15 13:38:34 +00:00
create_config_dir
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# The string passed to eval must handles spaces in paths correctly.
2014-02-11 01:54:45 +00:00
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
2015-05-04 14:10:25 +00:00
eval $COMMAND_LINE
local RETVAL=$?
if [ $RETVAL -ne '0' ] && [ $RETVAL -ne '2' ]; then
failed
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1
fi
}
waitforjavastartup() {
getstatus
2012-12-22 15:10:57 +00:00
eval echo $ECHOOPT "`gettext 'Waiting for $APP_LONG_NAME'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Wait until the timeout or we have something besides Unknown.
counter=15
while [ "$JAVASTATUS" = "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do
echo $ECHOOPT"."
sleep 1
getstatus
counter=`expr $counter - 1`
done
if [ -n "$WAIT_FOR_STARTED_TIMEOUT" ] ; then
counter=$WAIT_FOR_STARTED_TIMEOUT
else
counter=120
fi
while [ "$JAVASTATUS" != "STARTED" -a "$JAVASTATUS" != "Unknown" -a $counter -gt 0 -a -n "$JAVASTATUS" ] ; do
echo $ECHOOPT"."
sleep 1
getstatus
counter=`expr $counter - 1`
done
if [ "X$ECHOOPT" != "X" ] ; then
echo ""
fi
}
startwait() {
if [ $WAIT_FOR_STARTED_STATUS = true ]
then
waitforjavastartup
fi
# Sleep for a few seconds to allow for intialization if required
# then test to make sure we're still running.
#
i=0
while [ $i -lt $WAIT_AFTER_STARTUP ]
do
sleep 1
echo $ECHOOPT"."
i=`expr $i + 1`
done
if [ $WAIT_AFTER_STARTUP -gt 0 -o $WAIT_FOR_STARTED_STATUS = true ]
then
getpid
if [ "X$pid" = "X" ]
2004-08-19 04:48:42 +00:00
then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
2013-09-19 20:56:56 +00:00
failed
2004-08-19 04:48:42 +00:00
else
2012-12-22 15:10:57 +00:00
eval echo ' running: PID:$pid'
2004-08-19 04:48:42 +00:00
fi
else
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo ""
fi
}
macosxstart() {
# The daemon has been installed.
2012-12-22 19:30:36 +00:00
echo "Starting $APP_LONG_NAME. Detected Mac OSX and installed launchd daemon."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then
eval echo `gettext 'Must be root to perform this action.'`
exit 1
fi
getpid
if [ "X$pid" != "X" ] ; then
eval echo `gettext '$APP_LONG_NAME is already running.'`
2004-08-19 04:48:42 +00:00
exit 1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# If the daemon was just installed, it may not be loaded.
LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}`
if [ "X${LOADED_PLIST}" = "X" ] ; then
launchctl load /Library/LaunchDaemons/${APP_PLIST}
fi
# If launchd is set to run the daemon already at Load, we don't need to call start
getpid
2011-09-13 01:18:58 +00:00
if [ "X$pid" = "X" ] ; then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
launchctl start ${APP_PLIST_BASE}
fi
startwait
}
upstartstart() {
# The daemon has been installed.
2012-12-22 19:30:36 +00:00
echo "Starting $APP_LONG_NAME. Detected Linux and installed upstart."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then
eval echo `gettext 'Must be root to perform this action.'`
exit 1
fi
getpid
if [ "X$pid" != "X" ] ; then
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1
fi
/sbin/start ${APP_NAME}
startwait
2004-08-19 04:48:42 +00:00
}
start() {
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Starting $APP_LONG_NAME'`..."
2004-08-19 04:48:42 +00:00
getpid
if [ "X$pid" = "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
prepAdditionalParams "$@"
2013-05-15 13:38:34 +00:00
create_config_dir
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# The string passed to eval must handles spaces in paths correctly.
2014-02-11 01:54:45 +00:00
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
eval $COMMAND_LINE || failed
2004-08-19 04:48:42 +00:00
else
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext '$APP_LONG_NAME is already running.'`
2004-08-19 04:48:42 +00:00
exit 1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
startwait
2004-08-19 04:48:42 +00:00
}
2012-01-08 13:15:47 +00:00
2004-08-19 04:48:42 +00:00
stopit() {
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# $1 exit if down flag
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Stopping $APP_LONG_NAME'`..."
2004-08-19 04:48:42 +00:00
getpid
if [ "X$pid" = "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext '$APP_LONG_NAME was not running.'`
if [ "X$1" = "X1" ]
then
exit 1
fi
2004-08-19 04:48:42 +00:00
else
if [ "X$IGNORE_SIGNALS" = "X" ]
then
# Running so try to stop it.
2012-01-08 13:15:47 +00:00
kill -TERM $pid
2004-08-19 04:48:42 +00:00
if [ $? -ne 0 ]
then
# An explanation for the failure should have been given
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
2004-08-19 04:48:42 +00:00
exit 1
fi
else
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
rm -f "$ANCHORFILE"
if [ -f "$ANCHORFILE" ]
2004-08-19 04:48:42 +00:00
then
# An explanation for the failure should have been given
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
2004-08-19 04:48:42 +00:00
exit 1
fi
fi
# We can not predict how long it will take for the wrapper to
# actually stop as it depends on settings in wrapper.conf.
# Loop until it does.
savepid=$pid
CNT=0
TOTCNT=0
while [ "X$pid" != "X" ]
do
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Show a waiting message every 5 seconds.
if [ "$CNT" -lt "5" ]
2004-08-19 04:48:42 +00:00
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
CNT=`expr $CNT + 1`
2004-08-19 04:48:42 +00:00
else
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Waiting for $APP_LONG_NAME to exit'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
CNT=0
2004-08-19 04:48:42 +00:00
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
TOTCNT=`expr $TOTCNT + 1`
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
sleep 1
testpid
done
2004-08-19 04:48:42 +00:00
pid=$savepid
testpid
if [ "X$pid" != "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext 'Failed to stop $APP_LONG_NAME.'`
2004-08-19 04:48:42 +00:00
exit 1
else
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext 'Stopped $APP_LONG_NAME.'`
2004-08-19 04:48:42 +00:00
fi
fi
}
2012-01-08 13:15:47 +00:00
graceful() {
# $1 exit if down flag
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Stopping $APP_LONG_NAME gracefully'`..."
2012-01-08 13:15:47 +00:00
getpid
if [ "X$pid" = "X" ]
then
eval echo `gettext '$APP_LONG_NAME was not running.'`
if [ "X$1" = "X1" ]
then
exit 1
fi
else
if [ "X$IGNORE_SIGNALS" = "X" ]
then
# Running so try to stop it.
# This sends HUP. router.gracefulHUP must be set in router.config,
# or else this will do the same as stop.
2012-01-08 19:08:04 +00:00
kill -HUP $pid
2012-01-08 13:15:47 +00:00
if [ $? -ne 0 ]
then
# An explanation for the failure should have been given
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
exit 1
fi
else
rm -f "$ANCHORFILE"
if [ -f "$ANCHORFILE" ]
then
# An explanation for the failure should have been given
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
exit 1
fi
fi
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
pause() {
2012-12-22 19:30:36 +00:00
echo "Pausing $APP_LONG_NAME."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
}
resume() {
2012-12-22 19:30:36 +00:00
echo "Resuming $APP_LONG_NAME."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
}
2004-08-19 04:48:42 +00:00
status() {
getpid
if [ "X$pid" = "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext '$APP_LONG_NAME is not running.'`
2004-08-19 04:48:42 +00:00
exit 1
else
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "X$DETAIL_STATUS" = "X" ]
then
eval echo `gettext '$APP_LONG_NAME is running: PID:$pid'`
else
getstatus
eval echo `gettext '$APP_LONG_NAME is running: PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS'`
fi
2004-08-19 04:48:42 +00:00
exit 0
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
installUpstart() {
2012-12-22 19:30:36 +00:00
echo " Installing the $APP_LONG_NAME daemon using upstart.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "${APP_NAME}.conf" ] ; then
2012-12-22 19:30:36 +00:00
echo " a custom upstart conf file ${APP_NAME}.conf found"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
cp "${REALDIR}/${APP_NAME}.install" "/etc/init/${APP_NAME}.conf"
else
2012-12-22 15:10:57 +00:00
echo ' creating default upstart conf file..'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo "# ${APP_NAME} - ${APP_LONG_NAME}" > "/etc/init/${APP_NAME}.conf"
echo "description \"${APP_LONG_NAME}\"" >> "/etc/init/${APP_NAME}.conf"
echo "author \"Tanuki Software Ltd. <info@tanukisoftware.com>\"" >> "/etc/init/${APP_NAME}.conf"
echo "start on runlevel [2345]" >> "/etc/init/${APP_NAME}.conf"
echo "stop on runlevel [!2345]" >> "/etc/init/${APP_NAME}.conf"
echo "env LANG=${LANG}" >> "/etc/init/${APP_NAME}.conf"
echo "exec \"${REALPATH}\" launchdinternal" >> "/etc/init/${APP_NAME}.conf"
fi
}
2012-10-10 21:33:05 +00:00
installsystemd() {
if [ -d "/etc/systemd/system/" ]; then
cat << EOF >> "$SYSTEMD_SERVICE"
[Unit]
Description=$APP_LONG_NAME
2015-12-02 19:51:00 +00:00
After= local-fs.target network.target time-sync.target
2012-10-10 21:33:05 +00:00
[Service]
Type=forking
ExecStart=$I2P/i2prouter start
ExecReload=$I2P/i2prouter restart
ExecStop=$I2P/i2prouter stop
PIDFile=$I2P_CONFIG_DIR/i2p.pid
[Install]
WantedBy=multi-user.target
EOF
systemctl --system daemon-reload > /dev/null 2>&1
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
installdaemon() {
if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then
eval echo `gettext 'Must be root to perform this action.'`
exit 1
else
2011-09-30 16:02:02 +00:00
APP_NAME_LOWER=`echo "$APP_NAME" | $TREXE "[A-Z]" "[a-z]"`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "$DIST_OS" = "solaris" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Solaris:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f /etc/init.d/$APP_NAME ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
ln -s "$REALPATH" "/etc/init.d/$APP_NAME"
ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K20$APP_NAME_LOWER"
ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S20$APP_NAME_LOWER"
fi
elif [ "$DIST_OS" = "linux" ] ; then
if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected RHEL or Fedora:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
if [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then
installUpstart
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
ln -s "$REALPATH" "/etc/init.d/$APP_NAME"
/sbin/chkconfig --add "$APP_NAME"
/sbin/chkconfig "$APP_NAME" on
fi
fi
2012-10-10 22:44:42 +00:00
elif [ -f /etc/slackware-version ]; then
2012-12-22 15:10:57 +00:00
echo 'Detected Slackware Linux:'
2012-10-12 17:26:03 +00:00
if [ -e "/etc/rc.d/rc.i2p" -o -f "/etc/rc.d/rc.i2p.new" ]; then
echo "Found initscript from I2P Slackpkg. Aborting." >&2
2012-10-10 22:44:42 +00:00
exit 1
else
2012-10-12 17:26:03 +00:00
if grep -q ${APP_NAME}router /etc/rc.d/rc.local > /dev/null 2>&1; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
2012-10-12 17:26:03 +00:00
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
2012-10-10 22:44:42 +00:00
fi
fi
2011-09-12 23:03:52 +00:00
elif [ -f /etc/arch-release ]; then
2012-12-22 15:10:57 +00:00
echo 'Detected Arch Linux:'
2012-10-10 21:33:05 +00:00
if [ -f "/etc/rc.d/i2prouter" -o -f "/usr/lib/systemd/system/i2prouter.service" ]; then
2012-12-22 15:10:57 +00:00
echo 'AUR package found. Refusing to continue.'
2012-05-28 16:59:47 +00:00
exit 1
2012-10-10 21:33:05 +00:00
elif [ -f /etc/rc.d/i2p -a ! "$USE_SYSTEMD" = "1" ] || [ -f "$SYSTEMD_SERVICE" -a "$USE_SYSTEMD" = "1" ]; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
2012-05-28 16:59:47 +00:00
exit 1
else
2012-10-10 21:33:05 +00:00
if [ ! -f "/etc/init.d/i2p" ]; then
if [ "$USE_SYSTEMD" != "1" ]; then
echo "#!/bin/bash" > /etc/rc.d/${APP_NAME}
echo >> /etc/rc.d/${APP_NAME}
echo ". /etc/rc.conf" >> /etc/rc.d/${APP_NAME}
echo ". /etc/rc.d/functions" >> /etc/rc.d/${APP_NAME}
echo >> /etc/rc.d/${APP_NAME}
echo "case "\$1" in" >> /etc/rc.d/${APP_NAME}
echo " start)" >> /etc/rc.d/${APP_NAME}
echo " stat_busy \"Starting i2p-Router\"" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router start >/dev/null 2>&1" >> /etc/rc.d/${APP_NAME}
echo " if [ \$? -gt 0 ]; then" >> /etc/rc.d/${APP_NAME}
echo " stat_fail" >> /etc/rc.d/${APP_NAME}
echo " else" >> /etc/rc.d/${APP_NAME}
echo " stat_done" >> /etc/rc.d/${APP_NAME}
echo " add_daemon i2prouter" >> /etc/rc.d/${APP_NAME}
echo " fi" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " stop)" >> /etc/rc.d/${APP_NAME}
echo " stat_busy "Stopping i2p-Router"" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router stop > /dev/null 2>&1" >> /etc/rc.d/${APP_NAME}
echo " if [ \$? -gt 0 ]; then" >> /etc/rc.d/${APP_NAME}
echo " stat_fail" >> /etc/rc.d/${APP_NAME}
echo " else" >> /etc/rc.d/${APP_NAME}
echo " stat_done" >> /etc/rc.d/${APP_NAME}
echo " rm_daemon i2prouter" >> /etc/rc.d/${APP_NAME}
echo " fi" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " restart)" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router restart" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " console)" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router console" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " status)" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router status" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " dump)" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router dump" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " graceful)" >> /etc/rc.d/${APP_NAME}
echo " ${REALDIR}/${APP_NAME}router graceful" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo " *)" >> /etc/rc.d/${APP_NAME}
echo " echo \"usage: \$0 {start|stop|restart|console|status|dump}\"" >> /etc/rc.d/${APP_NAME}
echo " ;;" >> /etc/rc.d/${APP_NAME}
echo "esac" >> /etc/rc.d/${APP_NAME}
chmod 755 /etc/rc.d/${APP_NAME}
chown root:root /etc/rc.d/${APP_NAME}
2012-12-22 19:30:36 +00:00
echo " The $APP_LONG_NAME daemon has been installed."
2012-12-22 15:10:57 +00:00
echo ' Add \"i2p\" to the DAEMONS variable in /etc/rc.conf to enable.'
2012-10-10 21:33:05 +00:00
else
# We'll end up here if systemd is enabled.
# If systemd is enabled we don't need the initscript
rm -f /etc/rc.d/${APP_NAME}
fi
fi
if [ ! -f "${SYSTEMD_SERVICE}" ]; then
installsystemd
fi
2012-05-28 16:59:47 +00:00
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
elif [ -f /etc/SuSE-release ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected SuSE or SLES:'
2012-10-10 21:33:05 +00:00
if [ -f /etc/rc.d/${APP_NAME} -a ! "$USE_SYSTEMD" = "1" ] || [ -f "$SYSTEMD_SERVICE" -a "$USE_SYSTEMD" = "1" ]; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-10-10 21:33:05 +00:00
if [ ! -f "/etc/init.d/$APP_NAME" ]; then
if [ "$USE_SYSTEMD" != "1" ]; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
2012-10-10 21:33:05 +00:00
ln -s "$REALPATH" "/etc/init.d/$APP_NAME"
sed -i "s/Default-Start: 2 3 4 5/Default-Start: 5/" $0
insserv "/etc/init.d/$APP_NAME"
else
rm -f "/etc/init.d/$APP_NAME"
fi
fi
if [ ! -f "${SYSTEMD_SERVICE}" ]; then
installsystemd
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
2011-09-13 21:36:41 +00:00
elif [ -f /etc/lsb-release -o -f /etc/debian_version ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Debian-based distribution:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" -o -f "/etc/init/${APP_NAME}.conf" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
if [ -n "$USE_UPSTART" -a -d "/etc/init" ] ; then
installUpstart
else
2012-12-22 19:30:36 +00:00
echo " Installing the $APP_LONG_NAME daemon using init.d.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
ln -s "$REALPATH" "/etc/init.d/$APP_NAME"
update-rc.d "$APP_NAME" defaults
fi
fi
else
2012-12-22 15:10:57 +00:00
echo 'Detected Linux:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
ln -s "$REALPATH" /etc/init.d/$APP_NAME
ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/K20$APP_NAME_LOWER"
ln -s "/etc/init.d/$APP_NAME" "/etc/rc3.d/S20$APP_NAME_LOWER"
ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/S20$APP_NAME_LOWER"
ln -s "/etc/init.d/$APP_NAME" "/etc/rc5.d/K20$APP_NAME_LOWER"
fi
fi
elif [ "$DIST_OS" = "hpux" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected HP-UX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/sbin/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
ln -s "$REALPATH" "/sbin/init.d/$APP_NAME"
ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/K20$APP_NAME_LOWER"
ln -s "/sbin/init.d/$APP_NAME" "/sbin/rc3.d/S20$APP_NAME_LOWER"
fi
elif [ "$DIST_OS" = "aix" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected AIX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/rc.d/init.d/$APP_NAME" ] ; then
2012-12-22 19:30:36 +00:00
echo " The $APP_LONG_NAME daemon is already installed as rc.d script."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
elif [ -n "`/usr/sbin/lsitab $APP_NAME`" -a -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then
2012-12-22 19:30:36 +00:00
echo " The $APP_LONG_NAME daemon is already installed as SRC service."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -n "`/usr/sbin/lsitab install_assist`" ] ; then
2012-12-22 15:10:57 +00:00
echo ' The task /usr/sbin/install_assist was found in the inittab, this might cause problems for all subsequent tasks to launch at this process is known to block the init task. Please make sure this task is not needed anymore and remove/deactivate it.'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
/usr/bin/mkssys -s "$APP_NAME" -p "$REALPATH" -a "launchdinternal" -u 0 -f 9 -n 15 -S
/usr/sbin/mkitab "$APP_NAME":2:once:"/usr/bin/startsrc -s \"${APP_NAME}\" >/dev/console 2>&1"
fi
elif [ "$DIST_OS" = "freebsd" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected FreeBSD:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/rc.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf
if [ -f "${REALDIR}/${APP_NAME}.install" ] ; then
ln -s "${REALDIR}/${APP_NAME}.install" "/etc/rc.d/$APP_NAME"
else
echo '#!/bin/sh' > "/etc/rc.d/$APP_NAME"
echo "#" >> "/etc/rc.d/$APP_NAME"
echo "# PROVIDE: $APP_NAME" >> "/etc/rc.d/$APP_NAME"
echo "# REQUIRE: NETWORKING" >> "/etc/rc.d/$APP_NAME"
echo "# KEYWORD: shutdown" >> "/etc/rc.d/$APP_NAME"
echo ". /etc/rc.subr" >> "/etc/rc.d/$APP_NAME"
echo "name=\"$APP_NAME\"" >> "/etc/rc.d/$APP_NAME"
echo "rcvar=\`set_rcvar\`" >> "/etc/rc.d/$APP_NAME"
echo "command=\"${REALDIR}/${APP_NAME}router\"" >> "/etc/rc.d/$APP_NAME"
echo 'start_cmd="${name}_start"' >> "/etc/rc.d/$APP_NAME"
echo 'load_rc_config $name' >> "/etc/rc.d/$APP_NAME"
echo 'status_cmd="${name}_status"' >> "/etc/rc.d/$APP_NAME"
echo 'stop_cmd="${name}_stop"' >> "/etc/rc.d/$APP_NAME"
echo "${APP_NAME}_status() {" >> "/etc/rc.d/$APP_NAME"
echo '${command} status' >> "/etc/rc.d/$APP_NAME"
echo '}' >> "/etc/rc.d/$APP_NAME"
echo "${APP_NAME}_stop() {" >> "/etc/rc.d/$APP_NAME"
echo '${command} stop' >> "/etc/rc.d/$APP_NAME"
echo '}' >> "/etc/rc.d/$APP_NAME"
echo "${APP_NAME}_start() {" >> "/etc/rc.d/$APP_NAME"
echo '${command} start' >> "/etc/rc.d/$APP_NAME"
echo '}' >> "/etc/rc.d/$APP_NAME"
echo 'run_rc_command "$1"' >> "/etc/rc.d/$APP_NAME"
fi
echo "${APP_NAME}_enable=\"YES\"" >> /etc/rc.conf
chmod 555 "/etc/rc.d/$APP_NAME"
fi
elif [ "$DIST_OS" = "macosx" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Mac OSX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "${REALDIR}/${APP_PLIST}" ] ; then
ln -s "${REALDIR}/${APP_PLIST}" "/Library/LaunchDaemons/${APP_PLIST}"
else
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "/Library/LaunchDaemons/${APP_PLIST}"
echo "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo "<plist version=\"1.0\">" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <dict>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <key>Label</key>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <string>${APP_PLIST_BASE}</string>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <key>ProgramArguments</key>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <array>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <string>${REALDIR}/${APP_NAME}router</string>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <string>launchdinternal</string>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " </array>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <key>OnDemand</key>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <true/>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <key>RunAtLoad</key>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <true/>" >> "/Library/LaunchDaemons/${APP_PLIST}"
if [ "X$RUN_AS_USER" != "X" ] ; then
echo " <key>UserName</key>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo " <string>${RUN_AS_USER}</string>" >> "/Library/LaunchDaemons/${APP_PLIST}"
fi
echo " </dict>" >> "/Library/LaunchDaemons/${APP_PLIST}"
echo "</plist>" >> "/Library/LaunchDaemons/${APP_PLIST}"
fi
chmod 555 "/Library/LaunchDaemons/${APP_PLIST}"
fi
elif [ "$DIST_OS" = "zos" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected z/OS:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f /etc/rc.bak ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is already installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Installing the $APP_LONG_NAME daemon'`.."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
cp /etc/rc /etc/rc.bak
sed "s:echo /etc/rc script executed, \`date\`::g" /etc/rc.bak > /etc/rc
echo "_BPX_JOBNAME='${APP_NAME}' \"${REALDIR}/${APP_NAME}router\" start" >>/etc/rc
echo '/etc/rc script executed, `date`' >>/etc/rc
fi
else
eval echo `gettext 'Install not currently supported for $DIST_OS'`
exit 1
fi
fi
}
removedaemon() {
if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then
eval echo `gettext 'Must be root to perform this action.'`
exit 1
else
stopit "0"
2011-09-30 16:02:02 +00:00
APP_NAME_LOWER=`echo "$APP_NAME" | $TREXE "[A-Z]" "[a-z]"`
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "$DIST_OS" = "solaris" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Solaris:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
for i in "/etc/rc3.d/S20$APP_NAME_LOWER" "/etc/rc3.d/K20$APP_NAME_LOWER" "/etc/init.d/$APP_NAME"
do
rm -f $i
done
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
elif [ "$DIST_OS" = "linux" ] ; then
if [ -f /etc/redhat-release -o -f /etc/redhat_version -o -f /etc/fedora-release ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected RHEL or Fedora:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
/sbin/chkconfig "$APP_NAME" off
/sbin/chkconfig --del "$APP_NAME"
rm -f "/etc/init.d/$APP_NAME"
elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then
2012-12-22 19:30:36 +00:00
echo " Removing $APP_LONG_NAME daemon from upstart..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
rm "/etc/init/${APP_NAME}.conf"
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
2012-10-10 22:44:42 +00:00
elif [ -f /etc/slackware-version ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Slackware Linux:'
2012-10-10 22:44:42 +00:00
if grep -q ${APP_NAME}router /etc/rc.d/rc.local > /dev/null 2>&1 ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
2012-10-10 22:44:42 +00:00
sed -i "/i2prouter/d" /etc/rc.d/rc.local /etc/rc.d/rc.local_shutdown
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
2012-10-10 22:44:42 +00:00
exit 1
fi
2012-05-28 16:59:47 +00:00
elif [ -f /etc/arch-release ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Arch Linux:'
2012-10-10 21:33:05 +00:00
if [ -f "/etc/rc.d/$APP_NAME" -o -f "$SYSTEMD_SERVICE" ] ; then
2012-12-22 15:10:57 +00:00
eval echo "`gettext 'Removing $APP_LONG_NAME daemon'`..."
2012-05-28 16:59:47 +00:00
rm -f "/etc/rc.d/$APP_NAME"
2012-10-10 21:33:05 +00:00
rm -f "$SYSTEMD_SERVICE"
2012-05-28 16:59:47 +00:00
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
2012-05-28 16:59:47 +00:00
exit 1
fi
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
elif [ -f /etc/SuSE-release ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected SuSE or SLES:'
2012-10-10 21:33:05 +00:00
if [ -f "/etc/init.d/$APP_NAME" -o ${SYSTEMD_SERVICE} ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
insserv -r "/etc/init.d/$APP_NAME"
rm -f "/etc/init.d/$APP_NAME"
2012-10-10 21:33:05 +00:00
rm -f "$SYSTEMD_SERVICE"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
2011-09-13 21:36:41 +00:00
elif [ -f /etc/lsb-release -o -f /etc/debian_version ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Debian-based distribution:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" ] ; then
2012-12-22 19:30:36 +00:00
echo " Removing $APP_LONG_NAME daemon from init.d..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
update-rc.d -f "$APP_NAME" remove
rm -f "/etc/init.d/$APP_NAME"
elif [ -f "/etc/init/${APP_NAME}.conf" ] ; then
2012-12-22 19:30:36 +00:00
echo " Removing $APP_LONG_NAME daemon from upstart..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
rm "/etc/init/${APP_NAME}.conf"
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
else
2012-12-22 15:10:57 +00:00
echo 'Detected Linux:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
for i in "/etc/rc3.d/K20$APP_NAME_LOWER" "/etc/rc5.d/K20$APP_NAME_LOWER" "/etc/rc3.d/S20$APP_NAME_LOWER" "/etc/init.d/$APP_NAME" "/etc/rc5.d/S20$APP_NAME_LOWER"
do
rm -f $i
done
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
fi
elif [ "$DIST_OS" = "hpux" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected HP-UX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/sbin/init.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
for i in "/sbin/rc3.d/K20$APP_NAME_LOWER" "/sbin/rc3.d/S20$APP_NAME_LOWER" "/sbin/init.d/$APP_NAME"
do
rm -f $i
done
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
elif [ "$DIST_OS" = "aix" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected AIX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/rc.d/init.d/$APP_NAME" -o -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/rc.d/init.d/$APP_NAME" ] ; then
for i in "/etc/rc.d/rc2.d/S20$APP_NAME_LOWER" "/etc/rc.d/rc2.d/K20$APP_NAME_LOWER" "/etc/rc.d/init.d/$APP_NAME"
do
rm -f $i
done
fi
if [ -n "`/usr/sbin/lsitab $APP_NAME`" -o -n "`/usr/bin/lssrc -S -s $APP_NAME`" ] ; then
/usr/sbin/rmitab $APP_NAME
/usr/bin/rmssys -s $APP_NAME
fi
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
elif [ "$DIST_OS" = "freebsd" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected FreeBSD:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/etc/rc.d/$APP_NAME" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
for i in "/etc/rc.d/$APP_NAME"
do
rm -f $i
done
sed -i .bak "/${APP_NAME}_enable=\"YES\"/d" /etc/rc.conf
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
elif [ "$DIST_OS" = "macosx" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected Mac OSX:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Make sure the plist is installed
LOADED_PLIST=`launchctl list | grep ${APP_PLIST_BASE}`
if [ "X${LOADED_PLIST}" != "X" ] ; then
launchctl unload "/Library/LaunchDaemons/${APP_PLIST}"
fi
rm -f "/Library/LaunchDaemons/${APP_PLIST}"
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
elif [ "$DIST_OS" = "zos" ] ; then
2012-12-22 15:10:57 +00:00
echo 'Detected z/OS:'
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -f /etc/rc.bak ] ; then
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'Removing $APP_LONG_NAME daemon'`..."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
cp /etc/rc /etc/rc.bak
sed "s/_BPX_JOBNAME=\'APP_NAME\'.*//g" /etc/rc.bak > /etc/rc
rm /etc/rc.bak
else
2012-12-22 15:10:57 +00:00
eval echo " `gettext 'The $APP_LONG_NAME daemon is not currently installed.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
fi
else
eval echo `gettext 'Remove not currently supported for $DIST_OS'`
exit 1
fi
fi
}
2004-08-19 04:48:42 +00:00
dump() {
2012-12-22 19:30:36 +00:00
echo "Dumping $APP_LONG_NAME..."
2004-08-19 04:48:42 +00:00
getpid
if [ "X$pid" = "X" ]
then
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
eval echo `gettext '$APP_LONG_NAME was not running.'`
2004-08-19 04:48:42 +00:00
else
kill -3 $pid
if [ $? -ne 0 ]
then
2012-12-22 19:30:36 +00:00
echo "Failed to dump $APP_LONG_NAME."
2004-08-19 04:48:42 +00:00
exit 1
else
2012-12-22 19:30:36 +00:00
echo "Dumped $APP_LONG_NAME."
2004-08-19 04:48:42 +00:00
fi
fi
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Used by HP-UX init scripts.
startmsg() {
getpid
if [ "X$pid" = "X" ]
then
2012-12-22 19:30:36 +00:00
echo "Starting $APP_LONG_NAME... Wrapper:Stopped"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
if [ "X$DETAIL_STATUS" = "X" ]
then
2012-12-22 19:30:36 +00:00
echo "Starting $APP_LONG_NAME... Wrapper:Running"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
getstatus
2012-12-22 19:30:36 +00:00
echo "Starting $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
fi
2011-06-21 22:45:21 +00:00
}
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
# Used by HP-UX init scripts.
stopmsg() {
getpid
if [ "X$pid" = "X" ]
then
2012-12-22 19:30:36 +00:00
echo "Stopping $APP_LONG_NAME... Wrapper:Stopped"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
if [ "X$DETAIL_STATUS" = "X" ]
then
2012-12-22 19:30:36 +00:00
echo "Stopping $APP_LONG_NAME... Wrapper:Running"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
else
getstatus
2012-12-22 19:30:36 +00:00
echo "Stopping $APP_LONG_NAME... Wrapper:$STATUS, Java:$JAVASTATUS"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
fi
}
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
showUsage() {
# $1 bad command
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -n "$1" ]
then
2012-12-22 19:30:36 +00:00
echo "Unexpected command: $1"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo "";
fi
2004-08-19 04:48:42 +00:00
2012-12-22 15:10:57 +00:00
MSG='Usage: '
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ -n "$FIXED_COMMAND" ] ; then
if [ -n "$PASS_THROUGH" ] ; then
echo "${MSG} $0 {JavaAppArgs}"
else
echo "${MSG} $0"
fi
else
if [ -n "$PASS_THROUGH" ] ; then
echo "${MSG} $0 [ console {JavaAppArgs} | start {JavaAppArgs} | stop | restart {JavaAppArgs} | condrestart {JavaAppArgs} | status | install | remove | dump ]"
else
2014-02-16 11:28:48 +00:00
echo "${MSG} $0 [ console | start | stop | graceful | restart | condrestart | status | install | remove | dump ]"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
fi
fi
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ ! -n "$BRIEF_USAGE" ]
then
echo "";
if [ ! -n "$FIXED_COMMAND" ] ; then
echo "`gettext 'Commands:'`"
2012-12-22 15:10:57 +00:00
echo " console `gettext 'Launch in the current console.'`"
echo " start `gettext 'Start in the background as a daemon process.'`"
echo " stop `gettext 'Stop if running as a daemon or in another console.'`"
echo " graceful `gettext 'Stop gracefully, may take up to 11 minutes.'`"
echo " restart `gettext 'Stop if running and then start.'`"
echo " condrestart `gettext 'Restart only if already running.'`"
echo " status `gettext 'Query the current status.'`"
echo " install `gettext 'Install to start automatically when system boots.'`"
echo " remove `gettext 'Uninstall.'`"
echo " dump `gettext 'Request a Java thread dump if running.'`"
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo "";
fi
if [ -n "$PASS_THROUGH" ] ; then
2012-12-22 15:10:57 +00:00
echo "JavaAppArgs: Zero or more arguments which will be passed to the Java application."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
echo "";
fi
fi
2004-08-19 04:48:42 +00:00
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
exit 1
}
2004-08-19 04:48:42 +00:00
2011-09-13 00:09:36 +00:00
showsetusermesg() {
2013-07-02 18:08:52 +00:00
echo "`gettext 'Please edit i2prouter and set the variable RUN_AS_USER'`."
2011-09-13 00:09:36 +00:00
}
2011-09-13 01:16:12 +00:00
checkifstartingasroot() {
if [ ! `grep ^RUN_AS_USER $0` ] && [ ! `grep ^ALLOW_ROOT $0` ] && [ `id -ur` = '0' ]; then
2012-12-22 15:10:57 +00:00
echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
2011-09-13 01:16:12 +00:00
showsetusermesg
echo
2013-07-02 18:08:52 +00:00
echo "`gettext 'To run as root anyway, edit i2prouter and set ALLOW_ROOT=true.'`"
2011-09-13 01:16:12 +00:00
exit 1
fi
2012-10-10 21:33:05 +00:00
}
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
docommand() {
case "$COMMAND" in
'console')
2011-09-13 01:16:12 +00:00
checkifstartingasroot
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
checkUser touchlock "$@"
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
console "$@"
;;
'start')
2011-09-13 01:16:12 +00:00
checkifstartingasroot
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
macosxstart
elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then
checkUser touchlock "$@"
upstartstart
else
checkUser touchlock "$@"
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
start "$@"
fi
;;
'stop')
checkUser "" "$COMMAND"
stopit "0"
;;
2012-01-08 13:15:47 +00:00
'graceful')
checkUser "" "$COMMAND"
graceful "0"
;;
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
'restart')
checkUser touchlock "$COMMAND"
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
stopit "0"
start "$@"
;;
'condrestart')
checkUser touchlock "$COMMAND"
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
stopit "1"
start "$@"
;;
'status')
checkUser "" "$COMMAND"
status
;;
'install')
installdaemon
2011-09-13 00:09:36 +00:00
if [ ! `grep ^RUN_AS_USER $0` ]; then
2013-05-15 13:04:46 +00:00
echo
2011-09-13 00:09:36 +00:00
showsetusermesg
fi
2012-10-10 22:44:42 +00:00
echo
2012-10-10 21:33:05 +00:00
echo "You may want to disable the browser from launching at startup at"
echo "http://127.0.0.1:7657/configclients"
2013-05-15 13:04:46 +00:00
echo
echo "I2P_CONFIG_DIR is currently set to $I2P_CONFIG_DIR."
echo "Change the value in $0 if this is not"
echo "appropriate for your configuration."
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
;;
2011-09-18 15:37:31 +00:00
'remove' | 'uninstall')
update of the i2prouter script based upon Tanuki's 3.5.9 script
With this check-in comes an update of our i2prouter script based upon the
script src/bin/sh.script.in from the 3.5.9 source tarball of the wrapper.
Some of the benefits of this newer version include:
- logic to determine which wrapper binary to use (32bit VS 64bit) and falling
back to alternate "bitness." This would be most useful for portable packages.
- support for far more platforms and archs than the 3.1.1 based script (such as
Solaris, risc, os/390, HP-UX, AIX, mips, ia64, etc.)
- support for installing I2P as a daemon in most UNIX-based environments with
the command "i2prouter install". The installed service can be removed with
"i2prouter remove". With testing this option has been confirmed to work in
OSX, Fedora, Slackware, Debian, Ubuntu, FreeBSD, and SuSE. It does not work
in Arch Linux (yet).
2011-09-12 22:53:57 +00:00
removedaemon
;;
'dump')
checkUser "" "$COMMAND"
dump
;;
'start_msg')
# Internal command called by launchd on HP-UX.
checkUser "" "$COMMAND"
startmsg
;;
'stop_msg')
# Internal command called by launchd on HP-UX.
checkUser "" "$COMMAND"
stopmsg
;;
'launchdinternal')
# Internal command called by launchd on Max OSX.
# We do not want to call checkUser here as it is handled in the launchd plist file. Doing it here would confuse launchd.
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
launchdinternal "$@"
;;
*)
showUsage "$COMMAND"
;;
esac
}
docommand "$@"
2004-08-19 04:48:42 +00:00
exit 0