mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
Merge pull request #2 from iroh-eh/service
1. Added service files for wpa_supplicant and miracle-sink. 2. Miracle-sink automatically runs on the available link.
This commit is contained in:
commit
58c27198f1
3 changed files with 34 additions and 1 deletions
|
@ -771,10 +771,15 @@ void ctl_fn_peer_disconnected(struct ctl_peer *p)
|
|||
|
||||
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",
|
||||
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
|
||||
* start running if the link is now available. */
|
||||
if (!running_link && bound_link) {
|
||||
|
|
14
systemd/system/miracle-sink.service
Normal file
14
systemd/system/miracle-sink.service
Normal 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
|
14
systemd/system/miracle-wifid.service
Normal file
14
systemd/system/miracle-wifid.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=wpa_supplicant with Miracast support
|
||||
Before=network.target
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/miracle-wifid
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Alias=miracle-wifid.service
|
Loading…
Add table
Add a link
Reference in a new issue