Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[python] pptpd vpn auto-installer
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[python] pptpd vpn auto-installer

Mark_RMark_R Member

Hi,

I need some help with testing this pptpd vpn auto installer that i quickly wrote up to automate setting up my own servers - its currently very messy and basic coded but it does install + configure pptpd as it should on my servers, I need to know if it will work for you guys aswel, specially on lower end machines.

This only got tested on Debian 6 powered servers so far, full root access is required to run this without problems - ubuntu might prevents the installation from executing properly because of the sudo/su system, I plan to make a fix for this later on.

With your feedback I will be able to make more auto-install scripts and release them all at one place for everyone to use, if you want to help me improve this feel free to try executing the codes below and report any problems that arise.

$ apt-get update

>

$ apt-get install python

>

$ apt-get install python-pip

>

$ pip install termcolor

>

>

$ chmod +x 940170778c.py

>

$ python 940170778c.py

Thank you!

Comments

  • Why so many timeouts?

  • @cassa said:
    Why so many timeouts?

    mainly to make sure that the commands are finished before the script continues executing more, ontop of that I added a few extra time.sleep() lines to give the user time to read what the script actually is doing.

  • nullnullnullnull Member
    edited August 2014

    MASQUERADE may not be always available in OpenVZ.

    config_pptpd_iptablesfix overwrites /etc/rc.local it is not safe.

    Thanked by 1Mark_R
  • @nullnull said:
    MASQUERADE may not be always available in OpenVZ.

    config_pptpd_iptablesfix overwrites /etc/rc.local it is not safe.

    this script is not designed for OVZ (its for XEN, KVM, Dedicated servers), I should've stated that. my bad!

    and yeah about the overwriting of /etc/rc.local - its really a ghetto fix, i'm still working on ways to manipulate the code inside properly without affecting any other possibly user added code.

  • @Zen said:
    any reason commands is imported but not used?

    i've been adding, removing, modifying code alot to test different approaches, i'll clean up the code later. my priority right now is dealing with the rc.local problem.

  • @Zen said:
    Just use >> rather than > (>> will append/write to the end of the file. > will just overwrite everything.)

    this was the problem, the "exit 0" part of rc.local has to be the last line, if I remember correctly adding anything after it will break the file. what I tried is, first detecting + removing the "exit 0" part with sed and then append the firewall rule, after that we append the "exit 0" again. the problem here is that I couldnt remove the specific "exit 0" part - I dont know how to accomplish this.

    Thanked by 1Zen
  • @Zen said:

    exit 0 at the end of /etc/rc.local is annoying in Debian as well as "sh -e".

  • nullnullnullnull Member
    edited August 2014

    @Mark_R said:

    sed --follow-symlinks -i "s/^exit 0$//" /etc/rc.local

    Thanked by 1Mark_R
  • @nullnull said:
    sed --follow-symlinks -i "s/^exit 0$//" /etc/rc.local

    works great!

Sign In or Register to comment.