2004-08-25 11:20:56 +00:00
#!/bin/sh
# I2P Installer - Installs and pre-configures I2P.
#
# postinstall
# 2004 The I2P Project
2008-11-26 15:20:00 +00:00
# http://www.i2p2.de/
2004-08-25 11:20:56 +00:00
# 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
2005-09-17 07:31:48 +00:00
chmod 744 ./runplain.sh
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
2005-09-18 23:08:16 +00:00
OS_ARCH = ` uname -m`
X86_64 = ` echo " $OS_ARCH " | grep x86_64`
2004-08-25 11:20:56 +00:00
case $HOST_OS in
debian | fedora | gentoo | linux | mandrake | redhat | suse )
2005-09-18 23:08:16 +00:00
if [ " X $X86_64 " = "X" ] ; then
wrapperpath = "./lib/wrapper/linux"
cp $wrapperpath /libwrapper.so ./lib/
else
wrapperpath = "./lib/wrapper/linux64"
cp $wrapperpath /libwrapper.so ./lib
fi
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 .
2005-04-03 13:35:52 +00:00
chmod 744 ./eepget
2004-08-26 19:08:25 +00:00
chmod 744 ./i2psvc
2005-01-27 04:48:41 +00:00
chmod 744 ./scripts/i2pbench.sh
chmod 744 ./scripts/i2ptest.sh
2004-09-08 22:04:13 +00:00
rm -rf ./icons
rm -rf ./lib/wrapper
2004-09-03 16:52:27 +00:00
rm -f ./lib/*.dll
rm -f ./*.bat
2005-09-16 04:12:24 +00:00
rm -f ./*.exe
2009-06-11 23:38:15 +00:00
rm -rf ./installer
2009-07-15 15:29:37 +00:00
# no, let's not start the router from the install script any more
# ./i2prouter start
2004-08-25 11:20:56 +00:00
exit 0
2004-09-02 04:47:02 +00:00