Results 1 to 4 of 4

Thread: Shell script

  1. #1

    Unhappy Shell script

    Hi
    I have a shell script code and I can't find the meaning of the $MPB that used there .

    here is part of the code:
    Code:
    fprintf (script, "#-----------( Firestarter " VERSION ", Netfilter kernel subsystem in use )----------#\n");
    	fprintf (script, "#                                                                             #\n");
    	fprintf (script, "# This firewall was generated by Firestarter on %s              #\n", timestamp);
    	fprintf (script, "# http://www.fs-security.com                                                  #\n");
    	fprintf (script, "#                                                                             #\n");
    	fprintf (script, "#-----------------------------------------------------------------------------#\n\n");
      			
    	/* Autoloading of netfilter modules must be done before chains are flushed.*/
        fprintf (script, "\n# --------( Initial Setup - Firewall Modules Autoloader )--------\n\n");
    
    	fprintf (script, "# Remove ipchains module if found\n");
    	fprintf (script, "$LSM | grep ipchains -q -s && $RMM ipchains\n\n");
    
    	fprintf (script, "# Try to load every module we need\n");
    	fprintf (script, "$MPB ip_tables 2> /dev/null\n");
    	fprintf (script, "$MPB iptable_filter 2> /dev/null\n");
    	fprintf (script, "$MPB ipt_state 2> /dev/null\n");		
    	fprintf (script, "$MPB ip_conntrack 2> /dev/null\n");
    	fprintf (script, "$MPB ip_conntrack_ftp 2> /dev/null\n");
    	fprintf (script, "$MPB ip_conntrack_irc 2> /dev/null\n");
    	fprintf (script, "$MPB ipt_REJECT 2> /dev/null\n");
    	/* fprintf (script, "$MPB ipt_REDIRECT 2> /dev/null\n"); */
    	fprintf (script, "$MPB ipt_TOS 2> /dev/null\n");
    	fprintf (script, "$MPB ipt_MASQUERADE 2> /dev/null\n");
    	fprintf (script, "$MPB ipt_LOG 2> /dev/null\n");
    	fprintf (script, "$MPB iptable_mangle 2> /dev/null\n");
    	fprintf (script, "$MPB ipt_ipv4optsstrip 2> /dev/null\n");
    	fprintf (script, "if [ \"$NAT\" = \"on\" ]; then\n"
    			 "	$MPB iptable_nat 2> /dev/null\n"
    			 "	$MPB ip_nat_ftp 2> /dev/null\n"
    			 "	$MPB ip_nat_irc 2> /dev/null\n"
    			 "fi\n");
    
    	fprintf (script, "if [ \"EXT_PPP\" = \"on\" ]; then\n"
    			 "	$MPB bsd_comp 2> /dev/null\n"
    			 "	$MPB ppp_deflate 2> /dev/null\n"
    			 "fi\n\n");
    
       fprintf (script, "\n# --------( Initial Setup - Firewall Capabilities Check )--------\n\n");
    
    	fprintf (script, "# Make sure the test chains does not exist\n");
    	fprintf (script, "$IPT -F test 2> /dev/null\n"
    			 "$IPT -X test 2> /dev/null\n"
    			 "if [ \"$NAT\" = \"on\" ]; then\n"
    			 "	$IPT -t nat -F test 2> /dev/null\n"
    			 "	$IPT -t nat -X test 2> /dev/null\n"
    			 "fi\n\n");

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Shell script

    This is not a shell program. It's a C program that generates a shell program. Presumably $MPB is defined later when the script is run. It looks like it expands to the name of a utility program.

  3. #3

    Default Re: Shell script

    Thanks for your help

  4. #4
    Tilman Schmidt NNTP User

    Default Re: Shell script

    Ashkan s schrieb:
    > Hi
    > I have a shell script code and I can't find the meaning of the $MPB
    > that used there .


    From the look of it, $MPB is a shell variable that will be set to
    "/sbin/modprobe" before the generated script is run. I can't tell
    from here where this assignment might be done, because I don't know
    enough details about how Firestarter works.

    HTH
    T.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •