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
2011-06-07 14:53:10 +00:00
chmod 755 ./i2prouter
# chmod 755 ./install_i2p_service_unix
chmod 755 ./osid
chmod 755 ./runplain.sh
# chmod 755 ./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."
2011-06-14 18:11:43 +00:00
LOGFILE = ./postinstall.log
2004-09-02 04:47:02 +00:00
2004-08-25 11:20:56 +00:00
HOST_OS = ` ./osid`
2011-06-14 18:11:43 +00:00
if [ " X $HOST_OS " = "X" -o " X $HOST_OS " = "Xunknown" ] ; then
2004-08-25 11:20:56 +00:00
echo " $ERROR_MSG "
2011-06-14 18:11:43 +00:00
echo " Host OS is $HOST_OS " >> $LOGFILE
echo " Host architecture is $OS_ARCH " >> $LOGFILE
echo " $ERROR_MSG " >> $LOGFILE
2004-08-25 11:20:56 +00:00
exit 1
fi
2005-09-18 23:08:16 +00:00
OS_ARCH = ` uname -m`
2011-06-07 14:53:10 +00:00
X86_64 = ` echo " ${ OS_ARCH } " | grep x86_64`
2005-09-18 23:08:16 +00:00
2004-08-25 11:20:56 +00:00
case $HOST_OS in
debian | fedora | gentoo | linux | mandrake | redhat | suse )
2011-07-26 21:59:59 +00:00
if [ ` echo $OS_ARCH | grep armv7` ] ; then
wrapperpath = "./lib/wrapper/linux-armv7"
cp ${ wrapperpath } /libwrapper.so ./lib/
elif [ ` echo $OS_ARCH | grep arm` ] ; then
wrapperpath = "./lib/wrapper/linux-armv5"
2011-06-14 18:11:43 +00:00
cp ${ wrapperpath } /libwrapper.so ./lib/
2011-07-30 23:25:14 +00:00
elif [ ` echo $OS_ARCH | grep ppc` ] ; then
wrapperpath = "./lib/wrapper/linux-ppc"
cp ${ wrapperpath } /libwrapper.so ./lib/
2011-06-14 18:11:43 +00:00
elif [ " X $X86_64 " = "X" ] ; then
2005-09-18 23:08:16 +00:00
wrapperpath = "./lib/wrapper/linux"
2011-06-07 14:53:10 +00:00
cp ${ wrapperpath } /libwrapper.so ./lib/
2005-09-18 23:08:16 +00:00
else
wrapperpath = "./lib/wrapper/linux64"
2011-06-07 14:53:10 +00:00
cp ${ wrapperpath } /libwrapper.so ./lib
2011-06-12 21:42:09 +00:00
# the 32bit libwrapper.so will be needed if a 32 bit jvm is used
cp ./lib/wrapper/linux/libwrapper.so ./lib/libwrapper-linux-x86-32.so
2005-09-18 23:08:16 +00:00
fi
2004-08-25 11:20:56 +00:00
; ;
freebsd )
2011-06-14 18:11:43 +00:00
if [ ! ` echo $OS_ARCH | grep amd64` ] ; then
2011-06-07 14:53:10 +00:00
wrapperpath = "./lib/wrapper/freebsd"
cp ${ wrapperpath } /libwrapper.so ./lib/
else
wrapperpath = "./lib/wrapper/freebsd64"
cp ${ wrapperpath } /libwrapper.so ./lib/
2011-06-12 21:42:09 +00:00
# the 32bit libwrapper.so will be needed if a 32 bit jvm is used
cp ./lib/freebsd/libwrapper.so ./lib/libwrapper-freebsd-x86-32.so
2011-06-07 14:53:10 +00:00
fi
2004-08-25 11:20:56 +00:00
; ;
osx )
wrapperpath = "./lib/wrapper/macosx"
2011-06-07 14:53:10 +00:00
cp ${ wrapperpath } /libwrapper.jnilib ./lib/
2011-06-23 10:18:19 +00:00
chmod 755 ./Start\ I2P\ Router.app/Contents/MacOS/i2prouter
2004-08-25 11:20:56 +00:00
; ;
solaris )
wrapperpath = "./lib/wrapper/solaris"
2011-06-07 14:53:10 +00:00
cp ${ wrapperpath } /libwrapper.so ./lib/
2004-08-25 11:20:56 +00:00
; ;
* )
2011-06-07 14:53:10 +00:00
echo " ${ ERROR_MSG } "
2011-06-14 18:11:43 +00:00
echo " Host OS is $HOST_OS " >> $LOGFILE
echo " Host architecture is $OS_ARCH " >> $LOGFILE
echo " $ERROR_MSG " >> $LOGFILE
2004-08-25 11:20:56 +00:00
exit 1
; ;
esac
cp $wrapperpath /i2psvc .
2011-06-07 14:53:10 +00:00
chmod 755 ./eepget
chmod 755 ./i2psvc
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
2011-08-22 19:09:09 +00:00
rm -f ./fix_logfile_path.cmd
2005-09-16 04:12:24 +00:00
rm -f ./*.exe
2009-06-11 23:38:15 +00:00
rm -rf ./installer
2011-06-23 10:18:19 +00:00
if [ ! ` echo $HOST_OS | grep osx` ] ; then
rm -rf ./Start\ I2P\ Router.app
#rm -f I2P\ Router\ Console.webloc
fi
2009-07-15 15:29:37 +00:00
# no, let's not start the router from the install script any more
# ./i2prouter start
2011-08-06 22:38:37 +00:00
rm -f ./osid
rm -f ./postinstall.sh
2004-08-25 11:20:56 +00:00
exit 0
2004-09-02 04:47:02 +00:00