uiguy
June 5, 2019, 8:04am
1
Hi,
For some reason, I need to reset my VPN connection to my USG pro 4 quite often. I believe that this is due to UDP.
I have tried to create a Command line switch to reset this, but I cannot seem to get it to work
- platform: command_line
switches:
reboot_vpn:
command_on: "ssh -i /ssl/ubntPriv [email protected] 'restart vpn'"
command_off: "ssh -i /ssl/ubntPriv [email protected] 'restart vpn'"
I created an ssh certificate (ubntPriv) and placed it in /ssl
Can anyone help at all with this?
The error I get in the log is:
## Log Details (ERROR)
Wed Jun 05 2019 08:54:10 GMT+0100 (British Summer Time)
Command failed: ssh -i /ssl/ubntPriv [email protected] 'restart vpn
Maybe check this solution that works for turning on/off the Guest Network:
I created this script to be used from within Home Assistant. It can be used to enable, disable or check the status of a wifi network. Read the details below and check this gist for updates:
Last Updated: 7/28/18
Requirements:
jq
curl
User Config:
unifi_username: The username for your controller
unifi_password: The password for the user. Leave inside the single quotes.
unifi_controller: The URL where you access your controller.
wifi_id: The ID of the WiFi you’d like to control. Details for a…
You may also try to put your SSH command into a .sh script and call that from the command line. In the past i made the experience that this works while the direct command sometimes does not work.
jcconnell
(Jc Connell)
June 5, 2019, 2:37pm
3
There is an API available that you could explore to see if restarting the USG is an option.
This is a good resource for exploring the API: https://github.com/Art-of-WiFi/UniFi-API-browser
You might also check this link: http://onetimeblog6.blogspot.com/2015/03/how-to-restart-devices-on-unifi.html