Community discussions

MikroTik App
 
nemke
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Thu Jul 31, 2014 2:52 am

Script eanble/disable ppp

Sun Aug 01, 2021 12:19 am

Hello

Can someone tell why this script don;t work ? Hex S v6.48.3

:if ([/interface sstp-client get "VPN1" running]=true) do={ /interface l2tp-client set disabled=yes "VPN2"} else={:log warning "VPN1 NOT running.....starting VPN2 connection"; :/interface l2tp-client set disabled=no "VPN2";};
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Script eanble/disable ppp

Sun Aug 01, 2021 3:03 am

Yes, it does not work because without good layout you do not understand a star about what is written inside.

cleaning from useless, superfluous and errors:
/interface 
    :if ([get "VPN1" running]) do={
        :log warning "SSTP VPN1 running again, L2TP VPN2 is disactivating"
        disable "VPN2"
    } else={
        :log error "SSTP VPN1 not running, L2TP VPN2 is activating"
        enable "VPN2"
    }

Who is online

Users browsing this forum: JDF, miks and 25 guests