Adds support for pihole update manager (#151)
This commit is contained in:
committed by
Roey Darwish Dror
parent
ac2524edd7
commit
4f61a12013
@@ -104,6 +104,7 @@ Just run `topgrade`. It will run the following steps:
|
||||
* **Linux**: Run [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View
|
||||
only. No upgrades will actually be performed)
|
||||
* **Linux**: Run `rpi-update` to update Raspberry Pi Firmware
|
||||
* **Linux**: Run [pihole](https://pi-hole.net/) updater
|
||||
* Run custom defined commands
|
||||
* Final stage
|
||||
* **Linux**: Run [needrestart](https://github.com/liske/needrestart)
|
||||
|
||||
@@ -372,6 +372,12 @@ fn run() -> Result<(), Error> {
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
execute(
|
||||
&mut report,
|
||||
"pihole",
|
||||
|| linux::run_pihole_update(sudo.as_ref(), run_type),
|
||||
config.no_retry(),
|
||||
)?;
|
||||
execute(
|
||||
&mut report,
|
||||
"rpi-update",
|
||||
|
||||
@@ -310,6 +310,16 @@ pub fn run_rpi_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), E
|
||||
run_type.execute(sudo).arg(rpi_update).check_run()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn run_pihole_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
|
||||
let sudo = require_option(sudo)?;
|
||||
let pihole = require("pihole")?;
|
||||
|
||||
print_separator("pihole");
|
||||
|
||||
run_type.execute(sudo).arg(pihole).arg("-up").check_run()
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn run_etc_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
|
||||
let sudo = require_option(sudo)?;
|
||||
|
||||
Reference in New Issue
Block a user