* Debian: Fixup, update, enhance dream's scripts

* build.xml: Speed up sponge's distclean additions
This commit is contained in:
zzz
2010-01-26 15:21:41 +00:00
parent 474691927a
commit b97197c0fa
12 changed files with 127 additions and 42 deletions

6
debian/scripts/init vendored
View File

@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: i2p
@@ -13,8 +13,8 @@ set -e
. /lib/lsb/init-functions
function I2P {
su i2p -c "/var/lib/i2p/i2prouter $1"
I2P () {
su i2psvc -c "/usr/lib/i2p/i2prouter $1"
}
case "$1" in

View File

@@ -1,9 +1,14 @@
#!/bin/sh
TOP=/var/lib/i2p
useradd -b $TOP -r i2p 2>/dev/null
chown i2p $TOP -R
SVCHOME=/var/lib/i2p
I2P=/usr/lib/i2p
I2PUSER=i2psvc
update-rc.d
useradd -d $SVCHOME -r $I2PUSER
chown $I2PUSER:$I2PUSER $I2P -R
mkdir -p $SVCHOME
chown $I2PUSER:$I2PUSER $SVCHOME
cd $TOP
exec su i2p -c ./postinstall.sh
update-rc.d i2p defaults
cd $I2P
exec su $I2PUSER ./postinstall.sh

View File

@@ -1,2 +1,9 @@
#!/bin/sh
exec userdel i2p
I2PUSER=i2psvc
exec userdel $I2PUSER
# if somebody did updates in-network, there may be new files that dpkg
# doesn't know about, so just to be sure
I2P=/usr/lib/i2p
rm -rf $I2P

19
debian/scripts/prerm vendored
View File

@@ -1,2 +1,19 @@
#!/bin/sh
exec /etc/init.d/i2p stop
/etc/init.d/i2p stop
# stuff in /tmp
rm -f /tmp/wrapper.log /tmp/wrapper.log.1 /tmp/wrapper.log.2 /tmp/i2p.pid /tmp/routerjvm.pid /tmp/router.ping
# /etc/rc*.d/*i2p files
update-rc.d -f i2p remove
# dpkg doesn't know about these files, created by postinstall.sh
I2P=/usr/lib/i2p
rm -f $I2P/i2psvc $I2P/lib/libwrapper.so $I2P/lib/wrapper.jar
# the home directory for the i2p daemon
SVCHOME=/var/lib/i2p
rm -rf $SVCHOME
# if any user other than i2psvc has run i2p, the files in ~user/.i2p are not removed
exit 0