Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:11:47+00:00 2026-05-25T14:11:47+00:00

#!/usr/bin/perl use warnings; while(1){ system ( dialog –menu Customize 30 80 60 . ‘Show

  • 0
#!/usr/bin/perl
use warnings;
while(1){
system ( "dialog --menu Customize 30 80 60 "
        . "'Show rules' 'Show all the current rules' "
        . "'Flush rules' 'Flush all the tables' "
    . "Allow IP' 'Block all except one IP' "
    . "'Block IP' 'Block all the packets from an IP' "
    . "'Block MAC' 'Block using the hardware address' "
        . "'Private networking' 'Allow only one network and block other networks' "
    . "'Allow lo' 'Allow local network interface' "
    . "'Save' 'Save customized rules' "
    . "'Exit' 'Close the program' "
        . "'more options' '........' 2> /tmp/customize.txt");

open FILE4, "/tmp/customize.txt" or die $!;
chomp(my $customize = <FILE4>);
        #SHOW RULES
                if($customize =~ /Show rules/){
        `iptables -nvL | tee /tmp/nvl.txt`;
                system ("dialog --textbox /tmp/nvl.txt 22 70");
                }
        #FLUSH RULES
        elsif($customize =~ /Flush rules/){
        `iptables -F`;
        system ("dialog --infobox 'All tables have been flushed.' 05 35");
        sleep 2;
        }
        #ALLOW IP
        elsif($customize =~ /Allow IP/){
        system ("dialog --inputbox 'Enter the IP address of the sysetm which you want to allow:' 15 40 2> /tmp/allowIP.txt");
        open FILE7, "/tmp/allowIP.txt" or die $!;
        chomp(my $aip = <FILE7>);
        `iptables -I INPUT -s $aip -j DROP`;
        system ("dialog --infobox 'IP address $aip is allowed and rest are blocked' 05 45");
        sleep 2;
        }
        #BLOCK IP
        elsif($customize =~ /Block IP/){
        system ("dialog --inputbox 'Enter the IP address of the system which you want to block:' 15 40 2> /tmp/blockIP.txt");
        open FILE5, "/tmp/blockIP.txt" or die $!;
        chomp(my $ip = <FILE5>);
        `iptables -A INPUT -s $ip -j DROP`;
        system ("dialog --infobox 'IP address $ip has been blocked!' 05 35");
        sleep 2;
        }
        #PRIVATE NETWORK    
        elsif($customize =~ /Private networking/){
        system ("dialog --inputbox 'Enter the network address which you want to allow (eg. 192.168.0.0/24)' 15 40 2> /tmp/network.txt");
        open FILE6, "/tmp/network.txt" or die $!;
        chomp(my $network = <FILE6>);
        `iptables -I INPUT -s $network -j ACCEPT`;
        system ("dialog --infobox 'Network $network is allowed and rest networks are blocked' 05 35");
        sleep 2;
        }
        #ALLOW LO
        elsif($customize =~ /Allow lo/){
        `iptables -I INPUT -i lo -j ACCEPT`;
        system ("dialog --infobox 'Local interface is allowed.' 05 35");
        sleep 2;
        }
        #SAVE
        elsif($customize =~ /Save/){
        `service iptables save`;
        system ("dialog --infobox 'All rules have been saved successfully' 05 45");
        sleep 2;
        }
        #EXIT
        elsif($customize =~ /Exit/){
        system ("dialog --infobox 'Closing application.' 05 35");
        sleep 2;
        exit 0;
        }
                else{
                        exit;
                }
}

perl file.plx

error:

sh: -c: line 0: unexpected EOF while looking for matching `'' 
sh: -c: line 1: syntax error: unexpected end of file

How do I resolve this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:11:48+00:00Added an answer on May 25, 2026 at 2:11 pm

    Missing ' here: "Allow IP'

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!usr/bin/perl use strict; use warnings; my $file_name = rem.txt; open(FILE, $file_name); while (<FILE>) {
#!/usr/bin/perl use strict; use warnings; open(TEST, leet.txt) or die Can't open leet.txt: $!\n; while(my
Consider: #!/usr/bin/perl use strict; use warnings; my %hash; foreach (1 .. 10) { $hash{$_}
i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my
This code triggers the complaint below: #!/usr/bin/perl use strict; use warnings; my $s =
is there a way to get with printf colored output? #!/usr/bin/perl use warnings; use
!/usr/bin/env perl use warnings; use strict; my $text = 'hello ' x 30; printf
Which version would you prefer? #!/usr/bin/env perl use warnings; use strict; use 5.010; my
#!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML::Reader; my $reader = XML::LibXML::Reader->new(
#!/usr/bin/perl use strict; use warnings; open(my $vmstat, /usr/bin/vmstat 1 2>&1 |); open(my $foo, >,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.