Results 1 to 4 of 4

Thread: Terminal - How do I create an executable file?

  1. #1
    Join Date
    Feb 2009
    Beans
    43

    Terminal - How do I create an executable file?

    I need to create a file with a single iptable redirect command. I need it in /etc/init.d/

    File to be called 'transparentproxy'

    I'm assuming I have to do this from Terminal for rights.

    Can anyone help me with this?

    thanks!

  2. #2
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: Terminal - How do I create an executable file?

    Create a new file in /etc/init.d with

    Code:
    gksudo gedit /etc/init.d/transparentproxy
    and add whatever command you want in there after this line.

    Code:
    #!/bin/bash
    Save it and change the permissions to include an executable.

    Code:
    sudo chmod 755 /etc/init.d/transparentproxy
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

  3. #3
    Join Date
    Jan 2008
    Location
    /us/al/home/mb_webguy
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Terminal - How do I create an executable file?

    You don't have to do anything in the terminal. Just about anything you want to do can be done with GUI apps on the desktop. It's just that some things are easier or faster in the terminal.

    Ok, so I'm assuming you're wanting to run a command/script at startup, correct? The preferred method of doing so is by doing the following...

    1) Create a file called /etc/init.d/local, using the command "sudo gedit /etc/init.d/local". This is a shell script, so it should begin with:
    Code:
    #! /bin/sh
    The file should also end with:
    Code:
    exit 0
    Add any commands or applications you want to run at startup in the script, then save and exit.

    2) Make the script executable using the command "sudo chmod a+x /etc/init.d/local".

    3) Add the script to Init using the command "sudo update-rc.d local defaults 80".

    You only have to do steps 2 and 3 once. Afterwards, anything else you want to run at startup can just be added to the /etc/init.d/local file.

  4. #4
    Join Date
    Feb 2009
    Beans
    43

    Re: Terminal - How do I create an executable file?

    Very helpful thanks.

    Yes, the point was to install squid w/ dansguardian for filtering. It all works EXCEPT:

    I always have to restart squid after booting up to enable internet. Why?

Bookmarks

Posting Permissions

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