source: installer/resources/postinstall.sh @ b97197c

Last change on this file since b97197c was b97197c, checked in by zzz <zzz@…>, 10 years ago
  • Debian: Fixup, update, enhance dream's scripts
  • build.xml: Speed up sponge's distclean additions
  • Property mode set to 100644
File size: 1.9 KB
Line 
1#!/bin/sh
2
3# I2P Installer - Installs and pre-configures I2P.
4#
5# postinstall
6# 2004 The I2P Project
7# http://www.i2p2.de/
8# This code is public domain.
9#
10# author: hypercubus
11#
12# Installs the appropriate set of Java Service Wrapper support files for the
13# user's OS then launches the I2P router as a background service.
14
15if [ ! "X$1" = "X" ]; then
16    cd $1
17fi
18
19chmod 744 ./i2prouter
20# chmod 744 ./install_i2p_service_unix
21chmod 744 ./osid
22chmod 744 ./runplain.sh
23# chmod 744 ./uninstall_i2p_service_unix
24
25ERROR_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."
26
27HOST_OS=`./osid`
28
29if [ "X$HOST_OS" = "X" -o $HOST_OS = "unknown" ]; then
30    echo "$ERROR_MSG"
31    exit 1
32fi
33
34OS_ARCH=`uname -m`
35X86_64=`echo "$OS_ARCH" | grep x86_64`
36
37case $HOST_OS in
38    debian | fedora | gentoo | linux | mandrake | redhat | suse )
39        if [ "X$X86_64" = "X" ]; then
40            wrapperpath="./lib/wrapper/linux"
41            cp $wrapperpath/libwrapper.so ./lib/
42        else
43            wrapperpath="./lib/wrapper/linux64"
44            cp $wrapperpath/libwrapper.so ./lib
45        fi
46        ;;
47    freebsd )
48        wrapperpath="./lib/wrapper/freebsd"
49        cp $wrapperpath/libwrapper.so ./lib/
50        ;;
51    osx )
52        wrapperpath="./lib/wrapper/macosx"
53        cp $wrapperpath/libwrapper.jnilib ./lib/
54        ;;
55    solaris )
56        wrapperpath="./lib/wrapper/solaris"
57        cp $wrapperpath/libwrapper.so ./lib/
58        ;;
59    * )
60        echo "$ERROR_MSG"
61        exit 1
62        ;;
63esac
64
65cp $wrapperpath/wrapper.jar ./lib/
66cp $wrapperpath/i2psvc .
67chmod 744 ./eepget
68chmod 744 ./i2psvc
69rm -rf ./icons
70rm -rf ./lib/wrapper
71rm -f ./lib/*.dll
72rm -f ./*.bat
73rm -f ./*.exe
74rm -rf ./installer
75# no, let's not start the router from the install script any more
76# ./i2prouter start
77exit 0
78
Note: See TracBrowser for help on using the repository browser.