aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/hbbr.rs
diff options
context:
space:
mode:
authoropentrade <[email protected]>2021-04-08 17:53:56 +0800
committeropentrade <[email protected]>2021-04-08 17:53:56 +0800
commit25554dd3186cab764e499614a637f71be75b5d46 (patch)
tree472af0af35e2a833bebee168a471a6b11e68ea6b /src/hbbr.rs
parent92bd9c325053c5b21fb424a45eae7215160ed610 (diff)
downloadrustdesk-server-25554dd3186cab764e499614a637f71be75b5d46.tar.gz
rustdesk-server-25554dd3186cab764e499614a637f71be75b5d46.zip
lic draft
Diffstat (limited to 'src/hbbr.rs')
-rw-r--r--src/hbbr.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/hbbr.rs b/src/hbbr.rs
index c2ac21b..f0633a2 100644
--- a/src/hbbr.rs
+++ b/src/hbbr.rs
@@ -3,14 +3,17 @@ mod relay_server;
use hbb_common::{env_logger::*, ResultType};
use relay_server::*;
use std::sync::{Arc, Mutex};
+mod lic;
fn main() -> ResultType<()> {
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
let args = format!(
"-p, --port=[NUMBER(default={})] 'Sets the listening port'
-k, --key=[KEY] 'Only allow the client with the same key'
+ {}
",
- DEFAULT_PORT
+ DEFAULT_PORT,
+ lic::EMAIL_ARG
);
let matches = App::new("hbbr")
.version(hbbs::VERSION)
@@ -18,6 +21,9 @@ fn main() -> ResultType<()> {
.about("RustDesk Relay Server")
.args_from_usage(&args)
.get_matches();
+ if !lic::check_lic(matches.value_of("email").unwrap_or("")) {
+ return Ok(());
+ }
let stop: Arc<Mutex<bool>> = Default::default();
start(
matches.value_of("port").unwrap_or(DEFAULT_PORT),