Last active
February 10, 2022 01:04
-
-
Save george124816/52eb0c16bf00f7093a66f6ff937ba134 to your computer and use it in GitHub Desktop.
vpn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!elixir | |
case System.argv() do | |
["up"] -> | |
"nmcli connection up work" | |
|> String.to_charlist() | |
|> :os.cmd() | |
|> List.to_string() | |
|> String.trim() | |
|> IO.puts() | |
["down"] -> | |
"nmcli connection down work" | |
|> String.to_charlist() | |
|> :os.cmd() | |
|> List.to_string() | |
|> String.trim() | |
|> IO.puts() | |
_ -> | |
IO.puts("invalid command") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./vpn up
./vpn down