I was used to have a rsync call in my crontab to perform backup from my laptop to my desktop. My idea was to backup my laptop everyday even if I wasn’t at home, so before the time that the rsync ran I had to make sure that I was connected to my home network via OpenVPN and that my desktop was on. If the day was calm, no problem, but when I was busy at work that meant no backup for that day. I decided to code my own script to solve this problem.

for the dialogs, I had to install ‘xdialog’ Also, I’m calling another script called ‘vpn’ that I made with expect, it’s used to connect[…]