Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
reger committed Jul 22, 2014
2 parents e5854a5 + 172d7e6 commit dd311dd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions reconfigureYACY.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

# THIS SCRIPT CAN BE USED TO EDIT SOME BASIC SETTINGS OF YACY
#
# Copyright 2009 by Marc Nause; marc.nause@gmx.de
# Copyright 2009 - 2014 by Marc Nause; marc.nause@gmx.de
#
# This is a part of YaCy, a peer-to-peer based web search engine.
# http://www.yacy.net
#
# $LastChangedDate$
# $LastChangedRevision$
# $LastChangedBy$
#
# LICENSE
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -158,30 +154,30 @@ change_mem_settings()
esac
}

# CHANGES THE PORT SETTINGS
# CHANGES THE PORT SETTINGS. PROPERTY NAME IN FIRST PARAMETER, HUMAN READABLE NAME IN SECOND PARAMETER.
change_port_settings()
{
if read_parameter 'port'
if read_parameter $1
then
CURRENTPORT="$REPLY"
else
CURRENTPORT='unknown'
fi

echo
echo -n "Which port do you want YaCy to use (currently $CURRENTPORT)? "
echo -n "Which port do you want YaCy to use for $2 (currently $CURRENTPORT)? "
read INPUT

case $INPUT in
[0-9]*)
if [ "$INPUT" -ge 1024 ] && [ "$INPUT" -le 65535 ];
then
replace_parameter 'port' $INPUT
STATUS="Port settings have been changed. YaCy listens to port $INPUT now."
replace_parameter $1 $INPUT
STATUS="Port settings for $2 have been changed. YaCy listens to port $INPUT now."
else
echo
echo 'Please use choose a number between 1024 and 65535.'
change_port_settings
change_port_settings $1 $2
fi
;;
'')
Expand All @@ -190,7 +186,7 @@ change_port_settings()
*)
echo
echo 'Please enter a number or just hit enter to abort.'
change_port_settings
change_port_settings $1 $2
;;
esac
}
Expand Down Expand Up @@ -249,7 +245,8 @@ print_menu()
echo "Make your choice:"
echo "[1] change memory settings"
echo "[2] change admin password"
echo "[3] change port"
echo "[3] change HTTP port"
echo "[4] change HTTPS port"
echo "[0] quit"
echo
echo "Status: $STATUS"
Expand All @@ -259,7 +256,7 @@ print_menu()
# IF A SECOND PARAMETER, WHICH IS A VALID sed OPERATION LIKE "s/xxx/yyy/", EXISTS.
read_parameter()
{
REPLY="`cat "$CONFIGFILE" | grep "^$1" | sed "s/\(^$1 *= *\)\(.*\)$/\2/"`"
REPLY="`cat "$CONFIGFILE" | grep "^$1=" | sed "s/\(^$1 *= *\)\(.*\)$/\2/"`"
if [ "$2" != '' ]
then
REPLY="`echo "$REPLY" | sed $2`"
Expand Down Expand Up @@ -295,7 +292,10 @@ do
change_admin_settings
;;
3)
change_port_settings
change_port_settings 'port' 'HTTP'
;;
4)
change_port_settings 'port.ssl' 'HTTPS'
;;
esac
print_menu
Expand Down

0 comments on commit dd311dd

Please sign in to comment.