File: cloud-init-hotplugd

package info (click to toggle)
cloud-init 25.1.4-1%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,100 kB
  • sloc: python: 134,496; sh: 3,879; makefile: 128; javascript: 30; xml: 22
file content (23 lines) | stat: -rwxr-xr-x 707 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# This file is part of cloud-init. See LICENSE file for license information.

# This script is used on non-systemd systems. It is called by the
# cloud-init-hotplug init.d script.
#
# Creates a named pipe and then continually listens to this pipe. The pipe
# is written to by the hook-hotplug script (which is called by a udev rule
# upon a network device event). Anything received via the pipe is then
# passed on via the "cloud-init devel hotplug-hook handle" command.

PIPE="/run/cloud-init/share/hook-hotplug-cmd"

mkfifo -m700 $PIPE

while true; do
  # shellcheck disable=SC2162
  read args < $PIPE
  # shellcheck disable=SC2086
  exec /usr/bin/cloud-init devel hotplug-hook $args
done

exit