Skip to content

Instantly share code, notes, and snippets.

@george124816
Last active February 10, 2022 01:04
Show Gist options
  • Save george124816/52eb0c16bf00f7093a66f6ff937ba134 to your computer and use it in GitHub Desktop.
Save george124816/52eb0c16bf00f7093a66f6ff937ba134 to your computer and use it in GitHub Desktop.
vpn
#!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
@george124816
Copy link
Author

./vpn up
./vpn down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment