Skip to content

Instantly share code, notes, and snippets.

@george124816
Last active September 30, 2022 18:57
Show Gist options
  • Save george124816/73f0ea8065ef029f491d059803e45da5 to your computer and use it in GitHub Desktop.
Save george124816/73f0ea8065ef029f491d059803e45da5 to your computer and use it in GitHub Desktop.
VPN Script
#!/bin/elixir
System.argv()
|> case do
["up"] ->
System.cmd("nmcli", ["connection", "up", "work"])
|> IO.inspect()
["down"] ->
System.cmd("nmcli", ["connection", "down", "work"])
|> IO.inspect()
["restart"] ->
System.cmd("nmcli", ["connection", "down", "work"])
|> IO.inspect()
System.cmd("nmcli", ["connection", "up", "work"])
|> IO.inspect()
_ ->
IO.puts("invalid command")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment