Skip to content

Instantly share code, notes, and snippets.

@naoki-mizuno
Created May 22, 2020 04:34
Show Gist options
  • Save naoki-mizuno/ed4d40b63af6b6d12fd06b753a16b459 to your computer and use it in GitHub Desktop.
Save naoki-mizuno/ed4d40b63af6b6d12fd06b753a16b459 to your computer and use it in GitHub Desktop.
[Unit]
Description=ifup for NCXX USB Dongle (%I)
After=local-fs.target network-pre.target apparmor.service
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
DefaultDependencies=no
IgnoreOnIsolate=yes
StopWhenUnneeded=yes
[Service]
# avoid stopping on shutdown via stopping system-ifup.slice
Slice=system.slice
ExecStart=/bin/sh -ec 'sleep 2; ifup --allow=hotplug %I; ifup --allow=auto %I; \
if ifquery %I >/dev/null; then ifquery --state %I >/dev/null; fi'
ExecStop=/sbin/ifdown %I
RemainAfterExit=true
TimeoutStartSec=5min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment