1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

added sink service

This commit is contained in:
Avinash Pandey 2023-09-21 13:53:14 +05:30
parent 1cf7822228
commit 2107910a56
2 changed files with 20 additions and 1 deletions

View file

@ -748,10 +748,15 @@ void ctl_fn_peer_disconnected(struct ctl_peer *p)
void ctl_fn_link_new(struct ctl_link *l) void ctl_fn_link_new(struct ctl_link *l)
{ {
if (cli_running()) if (cli_running()){
cli_printf("[" CLI_GREEN "ADD" CLI_DEFAULT "] Link: %s\n", cli_printf("[" CLI_GREEN "ADD" CLI_DEFAULT "] Link: %s\n",
l->label); l->label);
// Automatically start the sink on the link.
char *args[1] = {l->label};
cmd_run(args, 1);
}
/* If we're not running but have a bound link, try to find it now and /* If we're not running but have a bound link, try to find it now and
* start running if the link is now available. */ * start running if the link is now available. */
if (!running_link && bound_link) { if (!running_link && bound_link) {

View file

@ -0,0 +1,14 @@
[Unit]
Description=Miraclecast sink on default link
Before=network.target
After=miracle-wifid.service
[Service]
Type=simple
ExecStart=/usr/bin/miracle-sinkctl
Restart=always
User=root
[Install]
WantedBy=multi-user.target
Alias=miracle-sink.service