|
|
|
@ -38,7 +38,7 @@ $IS_DEVEL = ( -e $config->{DEV_FEATURES_SCRIPT});
|
|
|
|
|
$STYLESHEET_URL = $config->{STYLESHEET_URL};
|
|
|
|
|
|
|
|
|
|
# TODO: just a quick-and-dirty hack during migration to multiple containers
|
|
|
|
|
my $CRYPTO_DEV = "`$CB_SCRIPT get_config device`2";
|
|
|
|
|
my $CRYPTO_DEV = `$CB_SCRIPT get_available_disks | cut -f 1 -d " " | tr "\n" "2"`;
|
|
|
|
|
|
|
|
|
|
my $query = new CGI;
|
|
|
|
|
|
|
|
|
@ -286,11 +286,11 @@ sub box_init
|
|
|
|
|
{
|
|
|
|
|
my ($crypto_pw, $admin_pw) = @_;
|
|
|
|
|
|
|
|
|
|
system("$CB_SCRIPT", "init");
|
|
|
|
|
system("$CB_SCRIPT", "init") || return 1;
|
|
|
|
|
|
|
|
|
|
# partitioning, config and initial cryptsetup
|
|
|
|
|
# TODO: define the name of the crypto container
|
|
|
|
|
# TODO: split init and create_crypto
|
|
|
|
|
open(PW_INPUT, "|$CB_SCRIPT crypto-create",$CRYPTO_DEV,"default");
|
|
|
|
|
open(PW_INPUT, "|$CB_SCRIPT crypto-create '$CRYPTO_DEV' default");
|
|
|
|
|
print PW_INPUT $crypto_pw;
|
|
|
|
|
close(PW_INPUT);
|
|
|
|
|
|
|
|
|
@ -404,7 +404,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
if ($query->param('type') eq 'reboot') {
|
|
|
|
|
&system_reboot();
|
|
|
|
|
$pagedata->setValue('Data.Success', 'ReBoot');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "180");
|
|
|
|
|
} else {
|
|
|
|
|
&system_poweroff();
|
|
|
|
@ -441,7 +441,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Success', 'UmountDone');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'empty');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -459,7 +459,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} elsif (&check_mounted()) {
|
|
|
|
|
$pagedata->setValue('Data.Warning', 'IsMounted');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'empty');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
} elsif ($query->param('crypto_password') eq '') {
|
|
|
|
|
# leeres Passwort
|
|
|
|
@ -474,7 +474,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Success', 'MountDone');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'empty');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -491,7 +491,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} elsif (&check_mounted()) {
|
|
|
|
|
$pagedata->setValue('Data.Warning', 'IsMounted');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'empty');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'form_mount');
|
|
|
|
@ -504,7 +504,7 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} elsif ( ! &check_mounted()) {
|
|
|
|
|
$pagedata->setValue('Data.Warning', 'NotMounted');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'empty');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'form_umount');
|
|
|
|
@ -606,8 +606,8 @@ if ( ! &check_ssl()) {
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Success', 'ConfigSaved');
|
|
|
|
|
}
|
|
|
|
|
$pagedata->setValue('Data.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -622,8 +622,8 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'form_config');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "30");
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60");
|
|
|
|
|
}
|
|
|
|
|
################### box_purge #######################
|
|
|
|
@ -655,8 +655,8 @@ if ( ! &check_ssl()) {
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'form_config');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60");
|
|
|
|
|
} elsif (&check_config()) {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'show_status');
|
|
|
|
|
$pagedata->setValue('Data.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Action', 'status');
|
|
|
|
|
$pagedata->setValue('Data.Redirect.Delay', "60");
|
|
|
|
|
} else {
|
|
|
|
|
$pagedata->setValue('Data.Action', 'form_init');
|
|
|
|
|