config is in slbackup 0.0.12-8.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | #!/usr/bin/perl -w
#
# $Id: slbackup.config,v 1.6 2007-12-23 12:46:22 werner Exp $
#
# Author: Morten Werne Olsen <werner@skolelinux.no>
#
use strict;
use Debconf::Client::ConfModule ":all";
## subroutines
# enable / disable backup and configuration
sub enable {
title("Configure backup system now?");
input("medium", "slbackup/enable");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
@ret = get("slbackup/enable");
if ($ret[1] eq "true") {
#return "backuptime";
return "client_name";
} else {
return "exit";
}
}
}
# time to start backup session
sub backuptime {
title("Time to run backup");
input("medium", "slbackup/backuptime");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
@ret = get("slbackup/backuptime");
if ($ret[1] =~ /^\d\d:\d\d$/) {
return "client_name";
} else {
return "backuptime";
}
}
}
# clients unique name
sub client_name {
title("Clients name");
input("medium", "slbackup/client_name");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "client_type";
}
}
# client type; local or extern
sub client_type {
title("Client type");
input("medium", "slbackup/client_type");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
@ret = get("slbackup/client_type");
if ($ret[1] eq "local") {
return "client_location";
} else {
return "client_address";
}
}
}
# client's hostname or IP-address
sub client_address {
title("Clients hostname or IP-address");
input("medium", "slbackup/client_address");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "client_user";
}
}
# user that runs the backup software on the client
sub client_user {
title("Username to run backup software");
input("medium", "slbackup/client_user");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "client_location";
}
}
# locations to back up on client
sub client_location {
title("Files/directories to back up");
input("medium", "slbackup/client_location");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "client_keep";
}
}
# destination dir to store backup on backup server
sub client_keep {
title("Number of days to keep backups for this client?");
input("medium", "slbackup/client_keep");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "server_type";
}
}
# server type; local or extern
sub server_type {
title("What kind of backup server?");
input("medium", "slbackup/server_type");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
@ret = get("slbackup/server_type");
if ($ret[1] eq "local") {
return "server_destdir";
} else {
return "server_address";
}
}
}
# server's hostname or IP-address
sub server_address {
title("Backup servers hostname or IP-address");
input("medium", "slbackup/server_address");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "server_user";
}
}
# user that runs the backup software on the backup server
sub server_user {
title("");
input("medium", "slbackup/server_user");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "server_destdir";
}
}
# destination dir to store backup on backup server
sub server_destdir {
title("Backups destination on backup server");
input("medium", "slbackup/server_destdir");
my @ret = go();
if ($ret[0] eq 30) {
return undef;
} else {
return "exit";
}
}
## start config
version('2.0');
capb('backup');
title("slbackup configuration");
my @statestack;
push @statestack, "exit";
# first move is to enable/disable backup and configuration
my $state = "enable";
while ($state ne "exit") {
no strict 'refs';
my $nextstate = &$state;
use strict;
if ($nextstate) {
push @statestack, $state;
} else {
$nextstate = pop @statestack;
}
$state = $nextstate;
}
|