fixed bug, that would prevent re-initialization after reboot (stunnel.pem)

re-indentation
switches dfsbuild-host from "localhost" to "127.0.0.1" (in case of missing fstab)
This commit is contained in:
lars 2005-09-20 23:52:20 +00:00
parent 882b9d1bb7
commit 4c1d197472
3 changed files with 16 additions and 15 deletions

View file

@ -105,12 +105,12 @@ function create_config()
cp -a "$CONFIG_DEFAULTS_DIR/." "$CONFIG_DIR"
log_msg "Copying temporary cerificate file to config filesystem ..."
# beware: the temp file should always be there - even after reboot - see "mount_config"
cp -p "$CERT_TEMP" "$CERT_FILE"
log_msg "Setting inital values ..."
# beware: config_set_value remounts the config partition read-only
config_set_value "device" "$1"
config_set_value "ip" "$(get_current_ip)"
# reinitialise configuration
@ -221,6 +221,8 @@ function mount_config()
if [ -n "$device" ] && mount "${device}1" "$CONFIG_DIR"
then log_msg "configuraton found on $device"
config_set_value "device" "$device"
# copy certificate to /tmp in case of re-initialization
cp "$CERT_FILE" "$CERT_TEMP"
return 0
else log_msg "failed to locate harddisk"
return 1
@ -319,8 +321,6 @@ ACTION=help
case "$ACTION" in
config-up )
# the "cruft" option could help to prevent the error "interleaved files not (yet) supported"
mount -o remount,cruft /
if mount_config
then echo "Cryptobox configuration successfully loaded"
else error_msg 3 "Could not find a configuration partition!"

View file

@ -48,6 +48,8 @@ sub load_hdf
(my $script_url = $ENV{'SCRIPT_NAME'}) =~ m/^[^&]*/;
$hdf->setValue("ScriptName", ($ENV{'SCRIPT_NAME'} eq '/')? '/cryptobox' : $script_url );
&load_selected_language($hdf);
&get_available_languages($hdf);
return $hdf;
@ -75,9 +77,9 @@ sub load_selected_language
# load the data
$config_language = "$weblang";
# add the setting to every link
$pagedata->setValue('Data.PostData.weblang', "$weblang");
$data->setValue('Data.PostData.weblang', "$weblang");
} else {
$pagedata->setValue('Data.Warning', 'InvalidLanguage');
$data->setValue('Data.Warning', 'InvalidLanguage');
}
}
# import the configured resp. the temporarily selected language
@ -86,13 +88,13 @@ sub load_selected_language
########## select documentation language ##########
if (&validate_doc_language($config_language)) {
# selected web interface language
$pagedata->setValue('Settings.DocLang', "$config_language");
$data->setValue('Settings.DocLang', "$config_language");
} elsif (&validate_doc_language($DEFAULT_LANGUAGE)) {
# configured CryptoBox language
$pagedata->setValue('Settings.DocLang', "$DEFAULT_LANGUAGE");
$data->setValue('Settings.DocLang', "$DEFAULT_LANGUAGE");
} else {
# default hardcoded language (english)
$pagedata->setValue('Settings.DocLang', "en");
$data->setValue('Settings.DocLang', "en");
}
}
@ -175,8 +177,6 @@ sub get_admin_pw
sub render
{
&load_selected_language($pagedata);
$pagedata->setValue("PageName","$pagename");
my $pagefile = "$HTML_TEMPLATE_DIR/main.cs";
print "Content-Type: text/html\n\n";
@ -450,6 +450,7 @@ if ( ! &check_ssl()) {
$pagedata->setValue('Data.Action', 'config_form');
} else {
system("$CB_SCRIPT", "set_config", "language", $query->param('language'));
&load_selected_language($pagedata);
system("$CB_SCRIPT", "set_config", "timeout", $query->param('timeout'));
# check, if the ip was reconfigured
if ($query->param('ip') ne `$CB_SCRIPT get_config ip`)

View file

@ -118,7 +118,7 @@ allpackages = util-linux
#patch
# Default mirror for "repo" sections
mirror = http://localhost/apt-cacher/ftp.de.debian.org/debian
mirror = http://127.0.0.1/apt-cacher/ftp.de.debian.org/debian
#mirror = http://ftp.debian.org/debian
#mirror = http://mirrors/debian