* moving wrapper scripts to installer/resources
* added wrapper files to the 'installer' target of the global build.xml
This commit is contained in:
338
installer/resources/i2prouter
Normal file
338
installer/resources/i2prouter
Normal file
@ -0,0 +1,338 @@
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# Skeleton sh script suitable for starting and stopping
|
||||
# wrapped Java apps on the Solaris platform.
|
||||
#
|
||||
# Make sure that PIDFILE points to the correct location,
|
||||
# if you have changed the default location set in the
|
||||
# wrapper configuration file.
|
||||
#
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# These settings can be modified to fit the needs of your application
|
||||
|
||||
# Application
|
||||
APP_NAME="i2p"
|
||||
APP_LONG_NAME="I2P Service"
|
||||
|
||||
# Wrapper
|
||||
WRAPPER_CMD="i2psvc"
|
||||
WRAPPER_CONF="wrapper.conf"
|
||||
|
||||
# Priority at which to run the wrapper. See "man nice" for valid priorities.
|
||||
# nice is only used if a priority is specified.
|
||||
PRIORITY=
|
||||
|
||||
# Location of the pid file.
|
||||
PIDDIR="."
|
||||
|
||||
# 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
|
||||
|
||||
# If specified, the Wrapper will be run as the specified user when the 'start'
|
||||
# command is passed to this script. When running with the 'console' command
|
||||
# the current user will be used.
|
||||
# IMPORTANT - Make sure that the user has the required privileges to write
|
||||
# the PID file and wrapper.log files. Failure to be able to write the log
|
||||
# file will cause the Wrapper to exit without any way to write out an error
|
||||
# message.
|
||||
# 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=
|
||||
|
||||
# Do not modify anything beyond this point
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Get the fully qualified path to the script
|
||||
case $0 in
|
||||
/*)
|
||||
SCRIPT="$0"
|
||||
;;
|
||||
*)
|
||||
PWD=`pwd`
|
||||
SCRIPT="$PWD/$0"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Change spaces to ":" so the tokens can be parsed.
|
||||
SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
|
||||
# Get the real path to this script, resolving any symbolic links
|
||||
TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'`
|
||||
REALPATH=
|
||||
for C in $TOKENS; do
|
||||
REALPATH="$REALPATH/$C"
|
||||
while [ -h "$REALPATH" ] ; do
|
||||
LS="`ls -ld "$REALPATH"`"
|
||||
LINK="`expr "$LS" : '.*-> \(.*\)$'`"
|
||||
if expr "$LINK" : '/.*' > /dev/null; then
|
||||
REALPATH="$LINK"
|
||||
else
|
||||
REALPATH="`dirname "$REALPATH"`""/$LINK"
|
||||
fi
|
||||
done
|
||||
done
|
||||
# Change ":" chars back to spaces.
|
||||
REALPATH=`echo $REALPATH | sed -e 's;:; ;g'`
|
||||
|
||||
# Change the current directory to the location of the script
|
||||
cd "`dirname "$REALPATH"`"
|
||||
|
||||
# Process ID
|
||||
ANCHORFILE="$PIDDIR/$APP_NAME.anchor"
|
||||
PIDFILE="$PIDDIR/$APP_NAME.pid"
|
||||
pid=""
|
||||
|
||||
# Resolve the location of the 'ps' command
|
||||
PSEXE="/usr/bin/ps"
|
||||
if [ ! -x $PSEXE ]
|
||||
then
|
||||
PSEXE="/bin/ps"
|
||||
if [ ! -x $PSEXE ]
|
||||
then
|
||||
echo "Unable to locate 'ps'."
|
||||
echo "Please report this with the location on your system."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build the nice clause
|
||||
if [ "X$PRIORITY" = "X" ]
|
||||
then
|
||||
CMDNICE=""
|
||||
else
|
||||
CMDNICE="nice -$PRIORITY"
|
||||
fi
|
||||
|
||||
# Check the configured user
|
||||
if [ "X$RUN_AS_USER" != "X" ]
|
||||
then
|
||||
if [ "`id -u -n`" = "$RUN_AS_USER" ]
|
||||
then
|
||||
# Already running as the configured user. Avoid password prompts by not calling su.
|
||||
RUN_AS_USER=""
|
||||
fi
|
||||
fi
|
||||
|
||||
getpid() {
|
||||
if [ -f $PIDFILE ]
|
||||
then
|
||||
if [ -r $PIDFILE ]
|
||||
then
|
||||
pid=`cat $PIDFILE`
|
||||
if [ "X$pid" != "X" ]
|
||||
then
|
||||
# Verify that a process with this pid is still running.
|
||||
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
# This is a stale pid file.
|
||||
rm -f $PIDFILE
|
||||
echo "Removed stale pid file: $PIDFILE"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Cannot read $PIDFILE."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
testpid() {
|
||||
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
# Process is gone so remove the pid file.
|
||||
rm -f $PIDFILE
|
||||
fi
|
||||
}
|
||||
|
||||
console() {
|
||||
echo "Running $APP_LONG_NAME..."
|
||||
getpid
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
if [ "X$IGNORE_SIGNALS" = "X" ]
|
||||
then
|
||||
exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE
|
||||
else
|
||||
exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE
|
||||
fi
|
||||
else
|
||||
echo "$APP_LONG_NAME is already running."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
echo "Starting $APP_LONG_NAME..."
|
||||
getpid
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
if [ "X$IGNORE_SIGNALS" = "X" ]
|
||||
then
|
||||
if [ "X$RUN_AS_USER" = "X" ]
|
||||
then
|
||||
exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE wrapper.daemonize=TRUE
|
||||
else
|
||||
su -m $RUN_AS_USER -c "exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE wrapper.daemonize=TRUE"
|
||||
fi
|
||||
else
|
||||
if [ "X$RUN_AS_USER" = "X" ]
|
||||
then
|
||||
exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE wrapper.ignore_signals=TRUE wrapper.daemonize=TRUE
|
||||
else
|
||||
su -m $RUN_AS_USER -c "exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF i2psvc.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE wrapper.ignore_signals=TRUE wrapper.daemonize=TRUE"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "$APP_LONG_NAME is already running."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
stopit() {
|
||||
echo "Stopping $APP_LONG_NAME..."
|
||||
getpid
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
echo "$APP_LONG_NAME was not running."
|
||||
else
|
||||
if [ "X$IGNORE_SIGNALS" = "X" ]
|
||||
then
|
||||
# Running so try to stop it.
|
||||
kill $pid
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
# An explanation for the failure should have been given
|
||||
echo "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
|
||||
echo "Unable to stop $APP_LONG_NAME."
|
||||
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
|
||||
# Loop for up to 5 minutes
|
||||
if [ "$TOTCNT" -lt "300" ]
|
||||
then
|
||||
if [ "$CNT" -lt "5" ]
|
||||
then
|
||||
CNT=`expr $CNT + 1`
|
||||
else
|
||||
echo "Waiting for $APP_LONG_NAME to exit..."
|
||||
CNT=0
|
||||
fi
|
||||
TOTCNT=`expr $TOTCNT + 1`
|
||||
|
||||
sleep 1
|
||||
|
||||
testpid
|
||||
else
|
||||
pid=
|
||||
fi
|
||||
done
|
||||
|
||||
pid=$savepid
|
||||
testpid
|
||||
if [ "X$pid" != "X" ]
|
||||
then
|
||||
echo "Timed out waiting for $APP_LONG_NAME to exit."
|
||||
echo " Attempting a forced exit..."
|
||||
kill -9 $pid
|
||||
fi
|
||||
|
||||
pid=$savepid
|
||||
testpid
|
||||
if [ "X$pid" != "X" ]
|
||||
then
|
||||
echo "Failed to stop $APP_LONG_NAME."
|
||||
exit 1
|
||||
else
|
||||
echo "Stopped $APP_LONG_NAME."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
getpid
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
echo "$APP_LONG_NAME is not running."
|
||||
exit 1
|
||||
else
|
||||
echo "$APP_LONG_NAME is running ($pid)."
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
dump() {
|
||||
echo "Dumping $APP_LONG_NAME..."
|
||||
getpid
|
||||
if [ "X$pid" = "X" ]
|
||||
then
|
||||
echo "$APP_LONG_NAME was not running."
|
||||
|
||||
else
|
||||
kill -3 $pid
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Failed to dump $APP_LONG_NAME."
|
||||
exit 1
|
||||
else
|
||||
echo "Dumped $APP_LONG_NAME."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
||||
'console')
|
||||
console
|
||||
;;
|
||||
|
||||
'start')
|
||||
start
|
||||
;;
|
||||
|
||||
'stop')
|
||||
stopit
|
||||
;;
|
||||
|
||||
'restart')
|
||||
stopit
|
||||
start
|
||||
;;
|
||||
|
||||
'status')
|
||||
status
|
||||
;;
|
||||
|
||||
'dump')
|
||||
dump
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 { console | start | stop | restart | status | dump }"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
40
installer/resources/i2prouter.bat
Normal file
40
installer/resources/i2prouter.bat
Normal file
@ -0,0 +1,40 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem
|
||||
rem Java Service Wrapper general startup script
|
||||
rem
|
||||
|
||||
rem
|
||||
rem Resolve the real path of the Wrapper.exe
|
||||
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
|
||||
rem can be hard-coded below and the following test removed.
|
||||
rem
|
||||
if "%OS%"=="Windows_NT" goto nt
|
||||
echo This script only works with NT-based versions of Windows.
|
||||
goto :eof
|
||||
|
||||
:nt
|
||||
rem
|
||||
rem Find the application home.
|
||||
rem
|
||||
rem %~dp0 is location of current script under NT
|
||||
set _REALPATH=%~dp0
|
||||
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
|
||||
|
||||
rem
|
||||
rem Find the wrapper.conf
|
||||
rem
|
||||
:conf
|
||||
set _WRAPPER_CONF="%~f1"
|
||||
if not %_WRAPPER_CONF%=="" goto startup
|
||||
set _WRAPPER_CONF="%_REALPATH%wrapper.conf"
|
||||
|
||||
rem
|
||||
rem Start the Wrapper
|
||||
rem
|
||||
:startup
|
||||
"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
|
||||
if not errorlevel 1 goto :eof
|
||||
pause
|
||||
|
116
installer/resources/install_i2p_service_unix
Normal file
116
installer/resources/install_i2p_service_unix
Normal file
@ -0,0 +1,116 @@
|
||||
#!/bin/sh
|
||||
|
||||
# I2P Installer - Installs and pre-configures I2P.
|
||||
#
|
||||
# install_i2p_service_unix
|
||||
# 2004 The I2P Project
|
||||
# http://www.i2p.net
|
||||
# This code is public domain.
|
||||
#
|
||||
# author: hypercubus
|
||||
#
|
||||
# Installs I2P as a service on various *nix systems using Wrapper. This script
|
||||
# must be run as root.
|
||||
#
|
||||
# Wrapper can be found at:
|
||||
# http://wrapper.tanukisoftware.org/doc/english/introduction.html
|
||||
|
||||
if [ $UID -ne 0 ]; then
|
||||
echo 'Sorry, you need root privileges to install services.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOST_OS=`uname -a`
|
||||
if [ ! '$HOST_OS' ]; then
|
||||
echo 'Cannot determine operating system type. Aborting service installation.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The following are several different service installation methods covering some
|
||||
# of the major *nix operating systems. Most *nix OSes should be able to use one
|
||||
# of these styles. TODO: AIX, HP-UX, HP-UX/64, IRIX, OSF/1.
|
||||
|
||||
install_bsd()
|
||||
{
|
||||
ln -sf `pwd`/i2psvc /usr/local/etc/rc.d/i2psvc.sh
|
||||
}
|
||||
|
||||
install_debian()
|
||||
{
|
||||
ln -sf `pwd`/i2psvc /etc/init.d/i2psvc
|
||||
update-rc.d i2psvc start 20 2 3 4 5 . stop 20 0 1 6 .
|
||||
}
|
||||
|
||||
install_gentoo()
|
||||
{
|
||||
ln -sf `pwd`/i2psvc /etc/init.d/i2psvc
|
||||
rc-update add i2psvc default
|
||||
}
|
||||
|
||||
install_redhat()
|
||||
{
|
||||
ln -sf `pwd`/i2psvc /etc/rc.d/init.d/i2psvc
|
||||
chkconfig --level 345 i2psvc on
|
||||
}
|
||||
|
||||
install_sysv()
|
||||
{
|
||||
ln -sf `pwd`/i2psvc /etc/init.d/i2psvc
|
||||
ln -sf /etc/init.d/i2psvc /etc/rc0.d/K20i2psvc
|
||||
ln -sf /etc/init.d/i2psvc /etc/rc1.d/K20i2psvc
|
||||
ln -sf /etc/init.d/i2psvc /etc/rc2.d/S20i2psvc
|
||||
ln -sf /etc/init.d/i2psvc /etc/rc3.d/S20i2psvc
|
||||
}
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Darwin` || `echo "$HOST_OS" | grep Macintosh` ]]; then
|
||||
install_bsd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep FreeBSD` ]]; then
|
||||
install_bsd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Linux` ]]; then
|
||||
|
||||
LINUX_DISTRO=`cat /proc/version`
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Debian` ]]; then
|
||||
install_debian
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Fedora` ]]; then
|
||||
install_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Gentoo` ]]; then
|
||||
install_gentoo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Mandrake` ]]; then
|
||||
install_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep "Red Hat"` ]]; then
|
||||
install_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Suse` ]]; then
|
||||
install_redhat
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Solaris` ]]; then
|
||||
install_sysv()
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo 'Cannot determine operating system type. Aborting service installation.'
|
||||
exit 1
|
35
installer/resources/install_i2p_service_winnt.bat
Normal file
35
installer/resources/install_i2p_service_winnt.bat
Normal file
@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem
|
||||
rem Java Service Wrapper general NT service install script
|
||||
rem
|
||||
|
||||
if "%OS%"=="Windows_NT" goto nt
|
||||
echo This script only works with NT-based versions of Windows.
|
||||
goto :eof
|
||||
|
||||
:nt
|
||||
rem
|
||||
rem Find the application home.
|
||||
rem
|
||||
rem %~dp0 is location of current script under NT
|
||||
set _REALPATH=%~dp0
|
||||
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
|
||||
|
||||
rem
|
||||
rem Find the wrapper.conf
|
||||
rem
|
||||
:conf
|
||||
set _WRAPPER_CONF="%~f1"
|
||||
if not %_WRAPPER_CONF%=="" goto startup
|
||||
set _WRAPPER_CONF="%_REALPATH%wrapper.conf"
|
||||
|
||||
rem
|
||||
rem Install the Wrapper as an NT service.
|
||||
rem
|
||||
:startup
|
||||
"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
|
||||
if not errorlevel 1 goto :eof
|
||||
pause
|
||||
|
116
installer/resources/uninstall_i2p_service_unix
Normal file
116
installer/resources/uninstall_i2p_service_unix
Normal file
@ -0,0 +1,116 @@
|
||||
#!/bin/sh
|
||||
|
||||
# I2P Installer - Installs and pre-configures I2P.
|
||||
#
|
||||
# uninstall_i2p_service_unix
|
||||
# 2004 The I2P Project
|
||||
# http://www.i2p.net
|
||||
# This code is public domain.
|
||||
#
|
||||
# author: hypercubus
|
||||
#
|
||||
# Uninstalls the Wrapper-based I2P service on various *nix systems. This script
|
||||
# must be run as root.
|
||||
#
|
||||
# Wrapper can be found at:
|
||||
# http://wrapper.tanukisoftware.org/doc/english/introduction.html
|
||||
|
||||
if [ $UID -ne 0 ]; then
|
||||
echo 'Sorry, you need root privileges to uninstall services.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOST_OS=`uname -a`
|
||||
if [ ! '$HOST_OS' ]; then
|
||||
echo 'Cannot determine operating system type. Please uninstall the service manually.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The following are several different service installation methods covering some
|
||||
# of the major *nix operating systems. Most *nix OSes should be able to use one
|
||||
# of these styles. TODO: AIX, HP-UX, HP-UX/64, IRIX, OSF/1.
|
||||
|
||||
uninstall_bsd()
|
||||
{
|
||||
rm /usr/local/etc/rc.d/i2psvc.sh
|
||||
}
|
||||
|
||||
uninstall_debian()
|
||||
{
|
||||
rm /etc/init.d/i2psvc
|
||||
update-rc.d -f i2psvc remove
|
||||
}
|
||||
|
||||
uninstall_gentoo()
|
||||
{
|
||||
rm /etc/init.d/i2psvc
|
||||
rc-update del i2psvc default
|
||||
}
|
||||
|
||||
uninstall_redhat()
|
||||
{
|
||||
rm /etc/rc.d/init.d/i2psvc
|
||||
chkconfig --level 345 i2psvc off
|
||||
}
|
||||
|
||||
uninstall_sysv()
|
||||
{
|
||||
rm /etc/init.d/i2psvc
|
||||
rm /etc/rc0.d/K20i2psvc
|
||||
rm /etc/rc1.d/K20i2psvc
|
||||
rm /etc/rc2.d/S20i2psvc
|
||||
rm /etc/rc3.d/S20i2psvc
|
||||
}
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Darwin` || `echo "$HOST_OS" | grep Macintosh` ]]; then
|
||||
uninstall_bsd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep FreeBSD` ]]; then
|
||||
uninstall_bsd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Linux` ]]; then
|
||||
|
||||
LINUX_DISTRO=`cat /proc/version`
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Debian` ]]; then
|
||||
uninstall_debian
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Fedora` ]]; then
|
||||
uninstall_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Gentoo` ]]; then
|
||||
uninstall_gentoo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Mandrake` ]]; then
|
||||
uninstall_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep "Red Hat"` ]]; then
|
||||
uninstall_redhat
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ `echo "$LINUX_DISTRO" | grep Suse` ]]; then
|
||||
uninstall_redhat
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ `echo "$HOST_OS" | grep Solaris` ]]; then
|
||||
uninstall_sysv()
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo 'Cannot determine operating system type. Please uninstall the service manually.'
|
||||
exit 1
|
35
installer/resources/uninstall_i2p_service_winnt.bat
Normal file
35
installer/resources/uninstall_i2p_service_winnt.bat
Normal file
@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
rem
|
||||
rem Java Service Wrapper general NT service uninstall script
|
||||
rem
|
||||
|
||||
if "%OS%"=="Windows_NT" goto nt
|
||||
echo This script only works with NT-based versions of Windows.
|
||||
goto :eof
|
||||
|
||||
:nt
|
||||
rem
|
||||
rem Find the application home.
|
||||
rem
|
||||
rem %~dp0 is location of current script under NT
|
||||
set _REALPATH=%~dp0
|
||||
set _WRAPPER_EXE=%_REALPATH%I2Psvc.exe
|
||||
|
||||
rem
|
||||
rem Find the wrapper.conf
|
||||
rem
|
||||
:conf
|
||||
set _WRAPPER_CONF="%~f1"
|
||||
if not %_WRAPPER_CONF%=="" goto startup
|
||||
set _WRAPPER_CONF="%_REALPATH%wrapper.conf"
|
||||
|
||||
rem
|
||||
rem Uninstall the Wrapper as an NT service.
|
||||
rem
|
||||
:startup
|
||||
"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
|
||||
if not errorlevel 1 goto :eof
|
||||
pause
|
||||
|
Reference in New Issue
Block a user