Startup script?

Discussion in 'Installation/Configuration' started by Dimitriy, Jun 26, 2006.

  1. Dimitriy

    Dimitriy New Member

    modprobe ipt_MASQUERADE
    iptables -F; iptables -t nat -F; iptables -t mangle -F
    iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 71.231.xx.xx
    echo 1 > /proc/sys/net/ipv4/ip_forward
    /etc/init.d/dhcp3-server start
    /etc/init.d/ispconfig_server start
    1. How add comments to this file? Is it "#" or "//" or something else?

    2. How to add this script to startup in Ubuntu (and other Distros...)?

    3. Do you consider this a clean/proper way to run your needed processes?

    I made this mini script so that I could add things to my startup without having to hassle on remembering each process and such. Also I am never worried about restarting and facing a issue where something doesnt work when something wasnt started.

    Its handy for me at least.

    My two cents,

    PS. The script/file needs to be executable. I dont remember the exact command (something like chmod+x 0666 or something) but if anybody knows be sure to mention it here.
  2. falko

    falko Super Moderator ISPConfig Developer

    It's #.
    Place the script in /etc/init.d, then make it executable:
    chmod 755 /etc/init.d/name_of_script
    Then run this:
    update-rc.d name_of_script defaults
    This will add the system startup links for the script.

Share This Page