New Linux v.61 with Cron Jobs

Okay, I had my access all set up to start and stop with scheduled cron jobs.  Wrote some nice scripts to use nmcli to start and stop the VPN.  Then v.61 came along, which I suppose is why my connection stopped working. 
I downloaded the new version and went to work trying to figure out how to make my cron jobs work the the new GUI app thingie.
Starting it was easy - "sh /home/YOURID/.pia_manager/pia_manager/run.sh --run" (or without the --run)
Stopping it, disconnecting, however, is elusive.
Meaghan and Trevor acted like they had no clue that Linux exists, much less what a Terminal, Shell, Cron Job or Command line is.
So, I know it runs on Ruby, as the run.sh basically runs run.rb - and that it opens a secure tunnel ( tun0 ).  Closing the tunnel didn't work.
When you click disconnect or exit on the GUI, it kicks off some script to reset the iptables, etc.
So, any idea how to gracefully disconnect the VPN in a script for a cron job?

Comments

  • edited July 2016
    sudo /sbin/ifconfig tun0 down

    The above command worked to get the tunnel disconnected... not sure if it left remnants in the iptables or not...

    But, it seems to work for the purpose.  (of course for the cron job, leave off sudo)

    Would still like to know if there is a way to replicate what clicking "disconnect" in the gui does.
Sign In or Register to comment.