+
+ # Workaround for PPPoE service and AC name options,
+ # filter out the nic-* argument and append it as last option
+ local nic=""
+ case "$1" in
+ nic-*) nic="$1"; shift ;;
+ esac
+
+ local proto
+ config_get proto "$cfg" proto
+
+ # unique link identifier
+ local link="${proto:-ppp}-$cfg"
+
+ # make sure only one pppd process is started
+ lock "/var/lock/ppp-${link}"
+ SERVICE_PID_FILE="/var/run/ppp-${link}.pid" \
+ service_check /usr/sbin/ppd && {
+ lock -u "/var/lock/ppp-${link}"
+ return 0
+ }
+
+ # Workaround: sometimes hotplug2 doesn't deliver the hotplug event for creating
+ # /dev/ppp fast enough to be used here
+ [ -e /dev/ppp ] || mknod /dev/ppp c 108 0
+
+ local device