summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/tinyfirewall56
1 files changed, 56 insertions, 0 deletions
diff --git a/perl-install/standalone/tinyfirewall b/perl-install/standalone/tinyfirewall
index f527f58df..17a87436b 100755
--- a/perl-install/standalone/tinyfirewall
+++ b/perl-install/standalone/tinyfirewall
@@ -29,4 +29,60 @@ $::isWizard = "@ARGV" =~ /--wizard/;
local $_ = join '', @ARGV;
my $in = vnew interactive('su');
+
+$::isEmbedded && ref($in) =~ /gtk/ or goto dd;
+require Gtk;
+init Gtk;
+
+my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
+$window1->signal_connect ( delete_event => sub { Gtk->exit(0); });
+$window1->set_position(1);
+$window1->set_title(_("Firewalling configuration", @all_cards));
+$window1->border_width(10);
+$::isEmbedded or $window1->set_usize(500, 400);
+my $vbox1 = new Gtk::VBox(0,0);
+$window1->add($vbox1);
+my $hbox1 = new Gtk::HBox(0,0);
+$vbox1->pack_start($hbox1,1,1,0);
+my $label1 = new Gtk::Label("");
+$hbox1->pack_start($label1,1,1,0);
+my $hbox2 = new Gtk::HBox(0,0);
+$vbox1->pack_start($hbox2,1,1,0);
+
+my $bbox1 = new Gtk::HButtonBox;
+$vbox1->pack_start($bbox1,0,0,0);
+$bbox1->set_layout(-end);
+my $button_conf = new Gtk::Button _("Configure");
+$button_conf->signal_connect ( clicked => sub {
+ system("/usr/sbin/tinyfirewall --wizard");
+ });
+$bbox1->add($button_conf);
+my $button_ok = new Gtk::Button _("OK");
+$button_ok->signal_connect ( clicked => sub {
+ quit_global();
+ });
+$bbox1->add($button_ok);
+$window1->show_all();
+update();
+Gtk->main_iteration while Gtk->events_pending;
+$::isEmbedded and kill USR2, $::CCPID;
+Gtk->main;
+Gtk->exit(0);
+
+sub update {
+$label1->set(-e "/etc/rc.d/rc3.d/S05bastille-firewall" ?
+ _("Firewalling
+
+You already have set up a firewall.
+Click on Configure to change or remove the firewall"):
+ _("Firewalling
+
+Click on Configure to set up a standard firewall"));
+}
+
+sub quit_global {
+ $::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0);
+}
+
+dd:
tinyfirewall::main($in);