class

Wgctl::Config::Writer

Inherits Reference < Object

Class methods

create_backup(filepath : String) : String | Nil

Creates a backup before saving Example: /etc/wireguard/backups/wg0.conf.2026-09-10T135400

Source
format(iface : Models::Interface) : String

Emits wireguard configuration text

Source
save_atomically(iface : Models::Interface, filepath : String, create_backup : Bool = true) : String

Atomically saves configuration to disk with 0600 permissions and optional backup

Source