Various Ubuntu changes.

This commit is contained in:
Robin Davies
2021-09-08 13:15:49 -04:00
parent eb0dc52322
commit 210e496ffd
12 changed files with 130 additions and 105 deletions
+16 -16
View File
@@ -37,11 +37,11 @@ void pipedal::SetWifiConfig(const WifiConfigSettings&settings)
char band;
if (!settings.enable_)
{
SysExec(SYSTEMCTL_BIN " stop hostapd");
SysExec(SYSTEMCTL_BIN " disable hostapd");
sysExec(SYSTEMCTL_BIN " stop hostapd");
sysExec(SYSTEMCTL_BIN " disable hostapd");
SysExec(SYSTEMCTL_BIN " enable wpa_supplicant");
SysExec(SYSTEMCTL_BIN " start wpa_supplicant");
sysExec(SYSTEMCTL_BIN " enable wpa_supplicant");
sysExec(SYSTEMCTL_BIN " start wpa_supplicant");
} else {
std::filesystem::path path("/etc/hostapd/hostapd.conf");
SystemConfigFile apdConfig;
@@ -167,29 +167,29 @@ void pipedal::SetWifiConfig(const WifiConfigSettings&settings)
// **************** start services ************
SysExec("rfkill unblock wlan");
SysExec(SYSTEMCTL_BIN " daemon-reload");
sysExec("rfkill unblock wlan");
sysExec(SYSTEMCTL_BIN " daemon-reload");
SysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
SysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
sysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
SysExec(SYSTEMCTL_BIN " unmask hostapd");
if (SysExec(SYSTEMCTL_BIN " restart hostapd") != 0)
sysExec(SYSTEMCTL_BIN " unmask hostapd");
if (sysExec(SYSTEMCTL_BIN " restart hostapd") != 0)
{
throw PiPedalException("Unable to start the access point.");
}
if (SysExec("systemctl is-active --quiet hostapd") != 0)
if (sysExec("systemctl is-active --quiet hostapd") != 0)
{
throw PiPedalException("Unable to start the access point.");
}
SysExec(SYSTEMCTL_BIN " enable hostapd");
sysExec(SYSTEMCTL_BIN " enable hostapd");
SysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
SysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
sysExec(SYSTEMCTL_BIN " stop wpa_supplicant");
sysExec(SYSTEMCTL_BIN " mask wpa_supplicant");
SysExec(SYSTEMCTL_BIN " restart dnsmasq");
SysExec(SYSTEMCTL_BIN " enable dnsmasq");
sysExec(SYSTEMCTL_BIN " restart dnsmasq");
sysExec(SYSTEMCTL_BIN " enable dnsmasq");
}