Shrewsoft command line interface to connect and terminate vpn on ubuntu

Shrewsoft [ 1 ] provides a command line interface for automatically configuring a vpn tunnel without user intervention, for example, using the following command

ikec -u username -p password -r configuration -a

Is there a way to detect if the connection attempt was successful, for example, by reading live logs and how we can end the vpn tunnel after a while using the command line. Any help would be noticeable.

+6
source share
1 answer

ikec -u username -p password -r configuration -a looking at the terminal output with ikec -u username -p password -r configuration -a , you can see if the connection was successful; if the output is ii : tunnel enabled , this means that the connection was successful and should work. If you receive a message like >> : detached from key daemon or failed to connect to key daemon , it means that there is a connection problem ( https://askubuntu.com/a/793336/705434 suggests running sudo /usr/sbin/iked to resolve to this particular error). To exit the ikec command, simply enter q into the terminal.

EDIT: it looks like this page ( https://gist.github.com/fschabmeyer/22b759994cf852df7e9b ) has a shell script that can handle detection, you should be able to add a case to exit the command automatically after a certain time.

+1
source

Source: https://habr.com/ru/post/972702/


All Articles