* now you are ask some questions to preconfigure yacy after installing the debian package git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7048 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
054c22e2c6
commit
1bc08e1416
@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# if we do not have debconf, we just skip this
|
||||
. /usr/share/debconf/confmodule || exit 0
|
||||
|
||||
CONFIGFILE=/var/lib/yacy/SETTINGS/yacy.conf
|
||||
|
||||
if [ ! -e $CONFIGFILE ]; then
|
||||
db_set yacy/peername $(hostname)
|
||||
else
|
||||
db_set yacy/peername $(grep "^peerName=" $CONFIGFILE | sed -e "s/peerName=\(.*\)/\1/")
|
||||
NETWORK_URL=$(grep "^network\.unit\.definition=" $CONFIGFILE | sed -e "s/network\.unit\.definition=\(.*\)/\1/")
|
||||
case "$NETWORK_URL" in
|
||||
defaults/yacy.network.freeworld.unit)
|
||||
db_set yacy/network freeworld
|
||||
;;
|
||||
defaults/yacy.network.intranet.unit)
|
||||
db_set yacy/network intranet
|
||||
;;
|
||||
defaults/yacy.network.allip.unit)
|
||||
db_set yacy/network allip
|
||||
;;
|
||||
defaults/yacy.network.webportal.unit)
|
||||
db_set yacy/network webportal
|
||||
;;
|
||||
*)
|
||||
db_set yacy/network url
|
||||
db_set yacy/network-url "$NETWORK_URL"
|
||||
;;
|
||||
esac
|
||||
db_set yacy/memory-start $(grep "^javastart_Xms=" $CONFIGFILE | sed -e "s/javastart_Xms=Xms\(.*\)m/\1/")
|
||||
db_set yacy/memory-max $(grep "^javastart_Xmx=" $CONFIGFILE | sed -e "s/javastart_Xmx=Xmx\(.*\)m/\1/")
|
||||
fi
|
||||
|
||||
db_capb backup
|
||||
|
||||
# use state machine to support step back
|
||||
|
||||
STATE=1
|
||||
while true; do
|
||||
case "$STATE" in
|
||||
1)
|
||||
# Two unrelated questions.
|
||||
db_input high yacy/peername || true
|
||||
db_input high yacy/password || true
|
||||
db_input high yacy/network || true
|
||||
;;
|
||||
2)
|
||||
# Only ask this question if the
|
||||
# first question was answered with
|
||||
# url
|
||||
db_get yacy/network
|
||||
if [ "$RET" = "url" ]; then
|
||||
db_input high yacy/network-url || true
|
||||
fi
|
||||
;;
|
||||
3)
|
||||
db_input high yacy/memory-start || true
|
||||
db_input high yacy/memory-max || true
|
||||
;;
|
||||
*)
|
||||
# The default case catches when $STATE is greater than the
|
||||
# last implemented state, and breaks out of the loop. This
|
||||
# requires that states be numbered consecutively from 1
|
||||
# with no gaps, as the default case will also be entered
|
||||
# if there is a break in the numbering
|
||||
break # exits the enclosing "while" loop
|
||||
;;
|
||||
esac
|
||||
|
||||
if db_go; then
|
||||
STATE=$(($STATE + 1))
|
||||
else
|
||||
STATE=$(($STATE - 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $STATE -eq 0 ]; then
|
||||
# The user has asked to back up from the first
|
||||
# question. This case is problematical. Regular
|
||||
# dpkg and apt package installation isn't capable
|
||||
# of backing up questions between packages as this
|
||||
# is written, so this will exit leaving the package
|
||||
# unconfigured - probably the best way to handle
|
||||
# the situation.
|
||||
exit 10
|
||||
fi
|
||||
|
@ -0,0 +1 @@
|
||||
misc:Depends=debconf (>= 0.5) | debconf-2.0
|
@ -0,0 +1,50 @@
|
||||
Template: yacy/peername
|
||||
Type: string
|
||||
Description: name for YaCy-peer
|
||||
|
||||
Template: yacy/password
|
||||
Type: password
|
||||
Description: Admin password
|
||||
Please choose an admin password for YaCy
|
||||
.
|
||||
If you leave this blank, YaCy's admin interface is accessable
|
||||
from localhost without password. If you already set
|
||||
a password, the old password won't be changed.
|
||||
|
||||
Template: yacy/network
|
||||
Type: select
|
||||
Choices: freeworld, intranet, allip, webportal, url
|
||||
Default: freeworld
|
||||
Description: Choose network to participate
|
||||
Choose a network:
|
||||
* freeworld: public general purpose YaCy network
|
||||
* intranet: index local (private) ips only
|
||||
* allip: private peer for all websites
|
||||
* webportal: public peer for specific websites
|
||||
* url: give custom network definition file via url
|
||||
|
||||
Template: yacy/network-url
|
||||
Type: string
|
||||
Description: URL for custom network definition file
|
||||
Use this to configure your own YaCy-network
|
||||
|
||||
Template: yacy/memory-start
|
||||
Type: string
|
||||
Default: 180
|
||||
Description: Initial java memory setting
|
||||
Initial memory (in MB) for java virtual machine, you are ask for the maximum memory usage in the next question.
|
||||
.
|
||||
If a high performance for large search indexes is wanted, then setting the values to equal number is recommended.
|
||||
.
|
||||
If YaCy shall be nice in not-only-yacy environments, then the Xms value may be lower
|
||||
|
||||
Template: yacy/memory-max
|
||||
Type: string
|
||||
Default: 600
|
||||
Description: Maximum java memory
|
||||
Maximum memory (in MB) for java virtual machine
|
||||
.
|
||||
If a high performance for large search indexes is wanted, then setting the values to equal number is recommended
|
||||
.
|
||||
If YaCy shall be nice in not-only-yacy environments, then the Xms value may be lower
|
||||
|
Loading…
Reference in new issue