Giter VIP home page Giter VIP logo

danialzash / openconnect Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

This repository contains a Bash script for Ubuntu systems, designed to streamline the process of managing VPN connections using openconnect. It offers a convenient way to check for the installation of openconnect, install it if necessary, and connect to a VPN server using credentials specified in a .env file.

Shell 100.00%

openconnect's Introduction

OpenConnect VPN Manager (ocvpn)

ocvpn is a simple yet powerful Bash script for managing VPN connections on Ubuntu systems. It utilizes openconnect for VPN connectivity and allows users to easily switch between multiple VPN profiles defined in an environment file.

Features

  • Automates the installation of openconnect if not present.
  • Manages multiple VPN connections through a .env configuration file.
  • Easy switching between different VPN profiles.

Prerequisites

  • Ubuntu or a similar Linux distribution.
  • Bash shell.
  • sudo privileges for installing openconnect.

Installation

  1. Clone the Repository:
git clone https://github.com/danialzash/openconnect.git
cd ocvpn
  1. Prepare the Environment File:
  • Copy the example environment file:
cp .env.example .env
  • Edit .env to include your VPN credentials and server details.
  1. Make the Script Executable:
chmod a+x ocvpn
  1. Optional: Add Script to Path

Move the script to a directory in your PATH, for example:

sudo mv ocvpn /usr/local/bin/
  • Reload the shell configuration:
source ~/.bashrc

Usage

After installation, you can use ocvpn to connect to your VPNs:

  • Connect to the Default VPN:
ocvpn
  • Connect to a Specific VPN Profile:

    • If you have VPN_SERVER_2 set in your .env, use:
ocvpn 2
  • Replace 2 with the appropriate profile number for other servers.

Configuring VPN Profiles

In the .env file, define each VPN profile like this:

VPN_USER=your_username
VPN_PASS=your_password
VPN_SERVER=vpn.default.com
VPN_SERVER_2=vpn.secondary.com
...

Replace the values with your actual VPN credentials and server addresses.

Contributing

Contributions are welcome! Feel free to submit pull requests or open issues for any improvements or suggestions.

openconnect's People

Contributors

danialzash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.