summarylogtreecommitdiffstats
path: root/netcfg.openrc
blob: b46e5fe8e1f4a39c81556696bc7afe4f24acd16f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/openrc-run
# OpenRC init script to configure the network via netcfg

## 'netcfg-daemon' configures netcfg profiles as specified in /etc/conf.d/netcfg

_EXECUTABLE="/usr/bin/netcfg-daemon"

depend() {
  need localmount
  after net.lo net.lo0 bootmisc
  provide net
  keyword -jail -prefix -vserver
}

start() {
  ebegin "Setting up netcfg network profiles"
  
  "${_EXECUTABLE}" start
  
  eend "$?"
}

stop() {
  ebegin "Deconfiguring netcfg network profiles"
  
  if netcfg-daemon status | grep -qvE '^netcfg\-daemon was not started'; then
    "${_EXECUTABLE}" stop
  else
    echo "netcfg-daemon was not started."
  fi
  
  eend "$?"
}