Revize 2069
Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)
freenetis/branches/1.1/application/vendors/deb/freenetis-redirection/config | ||
---|---|---|
db_get freenetis-redirection/hack_reload
|
||
if [ "$RET" = true ]; then
|
||
db_set freenetis-redirection/path_freenetis "$PATH_FN"
|
||
db_set freenetis-redirection/input_interface "$INPUT_INTERFACE"
|
||
db_set freenetis-redirection/self_cancel_target_ip "$IP_TARGET"
|
||
fi
|
||
fi
|
||
|
||
... | ... | |
|
||
# Ask questions.
|
||
db_input critical freenetis-redirection/path_freenetis || true
|
||
db_input critical freenetis-redirection/input_interface || true
|
||
db_input critical freenetis-redirection/self_cancel_target_ip || true
|
||
db_go || true
|
freenetis/branches/1.1/application/vendors/deb/freenetis-redirection/postinst | ||
---|---|---|
|
||
. $CONFIGFILE
|
||
|
||
ip_regex='^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
|
||
url_regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
|
||
|
||
# Substitute in the values from the debconf db.
|
||
... | ... | |
db_get freenetis-redirection/path_freenetis
|
||
PATH_FN="$RET"
|
||
|
||
db_get freenetis-redirection/input_interface
|
||
INPUT_INTERFACE="$RET"
|
||
|
||
db_get freenetis-redirection/self_cancel_target_ip
|
||
IP_TARGET="$RET"
|
||
|
||
# check path
|
||
if [ -z "$PATH_FN" ]; then
|
||
echo "Empty path to FreenetIS instance, configuration failed!"
|
||
... | ... | |
exit 3
|
||
fi
|
||
|
||
# check input iface
|
||
if [ -z "$INPUT_INTERFACE" ]; then
|
||
echo "Empty input interface, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
# check IP target
|
||
if [ -z "$IP_TARGET" ]; then
|
||
echo "Empty target IP for self-canceling, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
# check IP target format
|
||
if [[ ! "$IP_TARGET" =~ $ip_regex ]]; then
|
||
echo "Wrong format of the target IP for self-canceling, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
# check port
|
||
if [ -z "$PORT_REDIRECT" ]; then
|
||
echo "Empty port redirect, configuration failed!"
|
||
exit 3
|
||
fi
|
||
|
||
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
|
||
|
||
# If the admin deleted or commented some variables but then set
|
||
# them via debconf, (re-)add them to the conffile.
|
||
|
||
test -z "$PATH_FN" || grep -Eq '^ *PATH_FN=' $CONFIGFILE || echo "PATH_FN=" >> $CONFIGFILE
|
||
test -z "$INPUT_INTERFACE" || grep -Eq '^ *INPUT_INTERFACE=' $CONFIGFILE || echo "INPUT_INTERFACE=" >> $CONFIGFILE
|
||
test -z "$IP_TARGET" || grep -Eq '^ *IP_TARGET=' $CONFIGFILE || echo "IP_TARGET=" >> $CONFIGFILE
|
||
|
||
PATH_FN_ESCAPED="${PATH_FN//\//\\/}"
|
||
INPUT_INTERFACE_ESCAPED="${INPUT_INTERFACE//\//\\/}"
|
||
IP_TARGET_ESCAPED="${IP_TARGET//\//\\/}"
|
||
|
||
sed -e "s/^ *PATH_FN=.*/PATH_FN=\"$PATH_FN_ESCAPED\"/" \
|
||
-e "s/^ *INPUT_INTERFACE=.*/INPUT_INTERFACE=\"$INPUT_INTERFACE_ESCAPED\"/" \
|
||
-e "s/^ *IP_TARGET=.*/IP_TARGET=\"$IP_TARGET_ESCAPED\"/" < $CONFIGFILE > $CONFIGFILE.tmp
|
||
sed -e "s/^ *PATH_FN=.*/PATH_FN=\"$PATH_FN_ESCAPED\"/" < $CONFIGFILE > $CONFIGFILE.tmp
|
||
|
||
mv -f $CONFIGFILE.tmp $CONFIGFILE
|
||
|
freenetis/branches/1.1/application/vendors/deb/freenetis-redirection/templates | ||
---|---|---|
Description-cs.UTF-8: FreenetIS URL:
|
||
Cesta ke kořenu běžící instalace FreenetISu (např. http://freenet.org/is)
|
||
|
||
Template: freenetis-redirection/input_interface
|
||
Type: string
|
||
Default: eth0
|
||
Description: Input interface:
|
||
Input interface on which redirection rules are applicated on.
|
||
Description-cs.UTF-8: Vstupní rozhraní:
|
||
Vstupní rozhraní, na které jsou aplikována pravidla přesměrování a QoS download.
|
||
|
||
Template: freenetis-redirection/self_cancel_target_ip
|
||
Type: string
|
||
Default:
|
||
Description: Self cancel IP:
|
||
IP address which is use for self-canceling of the redirection directly by a redirected member.
|
||
Description-cs.UTF-8: IP adresa samozrušení
|
||
IP adresa, která je použita pro samozrušení přesměrování přesměrovaným členem.
|
||
|
||
Template: freenetis-redirection/hack_reload
|
||
Type: boolean
|
||
Default: true
|
Také k dispozici: Unified diff
Upravy:
- uprava konfigurace baliku freenetis-redirection verze 2.1