mirror of
https://github.com/0x1d/rcond.git
synced 2025-12-14 18:25:21 +01:00
feat: check if network connection already exists when adding a new one, update docs
This commit is contained in:
23
README.md
23
README.md
@@ -60,6 +60,29 @@ rcond:
|
||||
api_token: 1234567890
|
||||
```
|
||||
|
||||
### Network
|
||||
|
||||
Network connections can be configured in the `rcond.yaml` file, and these configurations are applied automatically when the node starts up. This allows for easy management of network settings, including the creation of access points and the sharing of network connections, without requiring manual intervention after each reboot.
|
||||
|
||||
Here is an example for creating an access point and share network connection on wlan0:
|
||||
|
||||
```yaml
|
||||
network:
|
||||
connections:
|
||||
- name: MyHomeWiFi
|
||||
type: 802-11-wireless
|
||||
interface: wlan0
|
||||
ssid: MyHomeWiFi
|
||||
mode: ap
|
||||
band: bg
|
||||
channel: 1
|
||||
keymgmt: wpa-psk
|
||||
psk: SuperSecure
|
||||
ipv4method: shared
|
||||
ipv6method: ignore
|
||||
autoconnect: true
|
||||
```
|
||||
|
||||
### Cluster
|
||||
|
||||
The cluster agent is a component of rcond that is responsible for joining and managing a cluster of rcond nodes.
|
||||
|
||||
@@ -237,6 +237,12 @@ func AddStationConnection(conn *dbus.Conn, uuid uuid.UUID, ssid string, password
|
||||
// Returns the D-Bus object path of the new connection profile.
|
||||
// Returns an error if the connection creation fails.
|
||||
func AddConnectionWithConfig(conn *dbus.Conn, cfg *ConnectionConfig) (dbus.ObjectPath, error) {
|
||||
|
||||
// check of connection already exists and return existing connection path
|
||||
if existingObjectPath, err := GetConnectionPath(conn, cfg.UUID); err == nil {
|
||||
return existingObjectPath, nil
|
||||
}
|
||||
|
||||
settingsObj := conn.Object(
|
||||
"org.freedesktop.NetworkManager",
|
||||
"/org/freedesktop/NetworkManager/Settings",
|
||||
|
||||
Reference in New Issue
Block a user