···146tunein play s221580
147```
148000000000000000000000149## API Documentation
150[https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1](https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1)
151
···146tunein play s221580
147```
148149+## ๐ง Systemd Service
150+151+Tunein daemon can be started as a systemd service. To enable and start the service, run the following command:
152+153+```bash
154+tunein service install
155+```
156+157+To disable and stop the service, run the following command:
158+159+```bash
160+tunein service uninstall
161+```
162+163+To check the status of the service, run the following command:
164+165+```bash
166+tunein service status
167+```
168+169+170## API Documentation
171[https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1](https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1)
172
+26
src/main.rs
···13mod provider;
14mod search;
15mod server;
016mod tags;
17mod tui;
18mod types;
···58 .about("Start the server")
59 .arg(arg!([port] "The port to listen on").default_value("8090")),
60 )
000000000000000061}
6263#[tokio::main]
···93 let port = port.parse::<u16>().unwrap();
94 server::exec(port).await?;
95 }
00000000096 _ => unreachable!(),
97 }
98
···13mod provider;
14mod search;
15mod server;
16+mod service;
17mod tags;
18mod tui;
19mod types;
···59 .about("Start the server")
60 .arg(arg!([port] "The port to listen on").default_value("8090")),
61 )
62+ .subcommand(
63+ Command::new("service")
64+ .about("Manage systemd service for tunein-cli server")
65+ .subcommand(
66+ Command::new("install")
67+ .about("Install systemd service for tunein-cli server")
68+ )
69+ .subcommand(
70+ Command::new("uninstall")
71+ .about("Uninstall systemd service for tunein-cli server")
72+ )
73+ .subcommand(
74+ Command::new("status")
75+ .about("Check status of tunein-cli systemd service")
76+ )
77+ )
78}
7980#[tokio::main]
···110 let port = port.parse::<u16>().unwrap();
111 server::exec(port).await?;
112 }
113+ Some(("service", sub_m)) => match sub_m.subcommand() {
114+ Some(("install", _)) => service::install()?,
115+ Some(("uninstall", _)) => service::uninstall()?,
116+ Some(("status", _)) => service::status()?,
117+ _ => {
118+ println!("Invalid subcommand. Use `tunein service --help` for more information");
119+ std::process::exit(1);
120+ }
121+ },
122 _ => unreachable!(),
123 }
124