aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-11-15 19:42:57 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-11-15 19:42:57 +0100
commite9efab27941c8c9f1f5d756dbf75e25b2e6838e5 (patch)
tree723468c500670cad949efd994e0082ee5d06c6ab
parent59f223ed04e09b0c85a141e4cd28ae021ee448af (diff)
make interface a constant
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 892f27d..b316784 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,6 +8,8 @@ use rsdsl_pppoe3::{Client, Error, Result};
use serde::{Deserialize, Serialize};
use sysinfo::{ProcessExt, Signal, System, SystemExt};
+const INTERFACE: &str = "eth1";
+
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
struct Config {
username: String,
@@ -17,7 +19,7 @@ struct Config {
#[tokio::main]
async fn main() -> Result<()> {
println!("[info] wait for eth1");
- link::wait_up("eth1".into()).await?;
+ link::wait_up(INTERFACE.into()).await?;
println!("[info] startup");
let mut config_file = File::open("/data/pppoe.conf")?;
@@ -41,7 +43,7 @@ async fn main() -> Result<()> {
let (v6_tx, mut v6_rx) = mpsc::unbounded_channel();
let client = Client::new(
- "eth1".into(),
+ INTERFACE.into(),
config.username,
config.password,
ds_config.v4.map(|v4| v4.addr),