style(openwrt): format TollGate installer
This commit is contained in:
@@ -69,8 +69,9 @@ pub fn install_tollgate(router: &Router) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Package not in any feed — download the .ipk directly.
|
// Package not in any feed — download the .ipk directly.
|
||||||
let arch = router
|
let arch = router.run_ok(
|
||||||
.run_ok("opkg print-architecture | grep -v all | grep -v noarch | tail -1 | awk '{print $2}'")?;
|
"opkg print-architecture | grep -v all | grep -v noarch | tail -1 | awk '{print $2}'",
|
||||||
|
)?;
|
||||||
let arch = arch.trim();
|
let arch = arch.trim();
|
||||||
|
|
||||||
let url = ipk_url(arch).ok_or_else(|| {
|
let url = ipk_url(arch).ok_or_else(|| {
|
||||||
@@ -162,8 +163,7 @@ pub fn install_tollgate_apk_native(router: &Router) -> Result<()> {
|
|||||||
size
|
size
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let (add_out, add_code) =
|
let (add_out, add_code) = router.run("apk add --allow-untrusted /tmp/tollgate.apk 2>&1")?;
|
||||||
router.run("apk add --allow-untrusted /tmp/tollgate.apk 2>&1")?;
|
|
||||||
router.run_ok("rm -f /tmp/tollgate.apk")?;
|
router.run_ok("rm -f /tmp/tollgate.apk")?;
|
||||||
if add_code != 0 {
|
if add_code != 0 {
|
||||||
anyhow::bail!("TollGate .apk install failed: {}", add_out.trim());
|
anyhow::bail!("TollGate .apk install failed: {}", add_out.trim());
|
||||||
|
|||||||
Reference in New Issue
Block a user