2004-08-25 11:20:56 +00:00
#!/bin/sh
# I2P Installer - Installs and pre-configures I2P.
#
# postinstall
# 2004 The I2P Project
# http://www.i2p.net
# This code is public domain.
#
# author: hypercubus
#
# Installs the appropriate set of Java Service Wrapper support files for the
# user's OS then launches the I2P router as a background service.
2004-09-02 04:47:02 +00:00
if [ ! " X $1 " = "X" ] ; then
2004-08-26 19:08:25 +00:00
cd $1
fi
chmod 744 ./i2prouter
2004-09-03 16:52:27 +00:00
# chmod 744 ./install_i2p_service_unix
2004-08-26 19:08:25 +00:00
chmod 744 ./osid
2004-09-03 16:52:27 +00:00
# chmod 744 ./uninstall_i2p_service_unix
2004-08-26 17:22:37 +00:00
ERROR_MSG = "Cannot determine operating system type. From the subdirectory in lib/wrapper matching your operating system, please move i2psvc to your base I2P directory, and move the remaining two files to the lib directory."
2004-09-02 04:47:02 +00:00
2004-08-25 11:20:56 +00:00
HOST_OS = ` ./osid`
2004-09-02 04:47:02 +00:00
if [ " X $HOST_OS " = "X" -o $HOST_OS = "unknown" ] ; then
2004-08-25 11:20:56 +00:00
echo " $ERROR_MSG "
exit 1
fi
case $HOST_OS in
debian | fedora | gentoo | linux | mandrake | redhat | suse )
wrapperpath = "./lib/wrapper/linux"
2004-08-29 20:15:31 +00:00
cp $wrapperpath /libwrapper.so ./lib/
2004-08-25 11:20:56 +00:00
; ;
freebsd )
wrapperpath = "./lib/wrapper/freebsd"
2004-08-29 20:15:31 +00:00
cp $wrapperpath /libwrapper.so ./lib/
2004-08-25 11:20:56 +00:00
; ;
osx )
wrapperpath = "./lib/wrapper/macosx"
2004-08-29 20:15:31 +00:00
cp $wrapperpath /libwrapper.jnilib ./lib/
2004-08-25 11:20:56 +00:00
; ;
solaris )
wrapperpath = "./lib/wrapper/solaris"
2004-08-29 20:15:31 +00:00
cp $wrapperpath /libwrapper.so ./lib/
2004-08-25 11:20:56 +00:00
; ;
* )
echo " $ERROR_MSG "
exit 1
; ;
esac
2004-08-29 20:15:31 +00:00
cp $wrapperpath /wrapper.jar ./lib/
2004-08-25 11:20:56 +00:00
cp $wrapperpath /i2psvc .
2004-08-26 19:08:25 +00:00
chmod 744 ./i2psvc
2004-09-03 16:52:27 +00:00
rm -rdf ./icons
rm -rdf ./lib/wrapper
rm -f ./lib/*.dll
rm -f ./*.bat
2004-08-26 17:22:37 +00:00
./i2prouter start
2004-08-25 11:20:56 +00:00
exit 0
2004-09-02 04:47:02 +00:00