@@ -372,35 +372,42 @@ async fn install_service() -> Result<ExitCode, Box<dyn std::error::Error>> {
372372 "devuan" | "slackware" => {
373373 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
374374 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
375- distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
375+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
376+ Ok ( res)
376377 }
377378 "alpine" | "gentoo" | "artix with openrc" => {
378379 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
379380 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
380- distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
381+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
382+ Ok ( res)
381383 }
382384 "void" | "artix with runit" => {
383385 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
384386 const UNIT_FILE_PATH : & str = "/etc/sv/netterd/run" ;
385- distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
387+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
388+ Ok ( res)
386389 }
387390 "artix with s6" => {
388391 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
389392 const UNIT_FILE_PATH : & str = "/etc/s6/sv/netterd/run" ;
390- distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
393+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
394+ Ok ( res)
391395 }
392396 "tinycore" | "minimal alpine" => {
393397 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
394398 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
395- distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
399+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
400+ Ok ( res)
396401 }
397402 "nixos" => {
398403 println ! ( "For NixOS, services must be defined in the system configuration." ) ;
404+ Err "Not supported OS ". into ( ) )
399405 }
400406 _ => {
401407 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
402408 const UNIT_FILE_PATH : & str = "/etc/systemd/system/netterd.service" ;
403- let _ = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ;
409+ let res = distributions_pathes ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
410+ Ok ( res)
404411 }
405412 }
406413 }
@@ -537,35 +544,42 @@ async fn uninstall_service() -> Result<ExitCode, Box<dyn std::error::Error>> {
537544 "devuan" | "slackware" => {
538545 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
539546 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
540- uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
547+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
548+ Ok ( res)
541549 }
542550 "alpine" | "gentoo" | "artix with openrc" => {
543551 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
544552 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
545- uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
553+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
554+ Ok ( res)
546555 }
547556 "void" | "artix with runit" => {
548557 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
549558 const UNIT_FILE_PATH : & str = "/etc/sv/netterd/run" ;
550- uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
559+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
560+ Ok ( res)
551561 }
552562 "artix with s6" => {
553563 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
554564 const UNIT_FILE_PATH : & str = "/etc/s6/sv/netterd/run" ;
555- uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
565+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
566+ Ok ( res)
556567 }
557568 "tinycore" | "minimal alpine" => {
558569 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
559570 const UNIT_FILE_PATH : & str = "/etc/init.d/netterd" ;
560- uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
571+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ?;
572+ Ok ( res)
561573 }
562574 "nixos" => {
563575 println ! ( "For NixOS, services must be defined in the system configuration." ) ;
576+ Err ( "Unsupported OS" . into ( ) )
564577 }
565578 _ => {
566579 const SERVICE_DEST_STR : & str = "/usr/local/bin/netterd" ;
567580 const UNIT_FILE_PATH : & str = "/etc/systemd/system/netterd.service" ;
568- let _ = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ;
581+ let res = uninstall_netterd_service ( SERVICE_DEST_STR , UNIT_FILE_PATH ) . await ;
582+ Ok ( res)
569583 }
570584 }
571585 }
0 commit comments