feat: Add WireGuard installer
- Add a new WireGuard installer to the project. - This installer handles installation and uninstallation of WireGuard. Co-authored-by: mahmmoud.hassanein <mahmmoud.hassanein@gmail.com>
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
#!/usr/bin/env -S v -n -w -gc none -no-retry-compilation -d use_openssl -enable-globals run
|
||||
|
||||
import freeflowuniverse.herolib.clients.wireguard
|
||||
import freeflowuniverse.herolib.installers.net.wireguard as wireguard_installer
|
||||
import time
|
||||
import os
|
||||
|
||||
mut wg_installer := wireguard_installer.get()!
|
||||
wg_installer.install()!
|
||||
|
||||
// Create Wireguard client
|
||||
mut wg := wireguard.get()!
|
||||
config_file_path := '${os.dir(@FILE)}/wg0.conf'
|
||||
@@ -27,3 +31,5 @@ println('public_key: ${public_key}')
|
||||
|
||||
wg.down(config_file_path: config_file_path)!
|
||||
println('${config_file_path} is down')
|
||||
|
||||
wg_installer.destroy()!
|
||||
|
||||
Reference in New Issue
Block a user