network: don't use "ifup -m"
[dracut.git] / modules.d / 99base / initqueue.sh
blob193cc5c6c62c9ce29419a23b499da70eb2e6a5de
1 #!/bin/sh
3 # Licensed under the GPLv2+
5 # Copyright 2008-2010, Red Hat, Inc.
6 # Harald Hoyer <harald@redhat.com>
8 PATH=/usr/sbin:/usr/bin:/sbin:/bin
10 type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
12 while [ $# -gt 0 ]; do
13 case "$1" in
14 --onetime)
15 onetime="yes";;
16 --settled)
17 qname="/settled";;
18 --finished)
19 qname="/finished";;
20 --timeout)
21 qname="/timeout";;
22 --unique)
23 unique="yes";;
24 --name)
25 name="$2";shift;;
26 --env)
27 env="$2"; shift;;
29 break;;
30 esac
31 shift
32 done
34 if [ -z "$unique" ]; then
35 job="${name}$$"
36 else
37 job="${name:-$1}"
38 job=${job##*/}
41 exe=$1
42 shift
44 [ -x "$exe" ] || exe=$(command -v $exe)
45 if [ -z "$exe" ] ; then
46 echo "Invalid command"
47 exit 1
51 [ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"'
52 [ -n "$env" ] && echo "$env"
53 echo "$exe $@"
54 } > "/tmp/$$-${job}.sh"
56 mv -f "/tmp/$$-${job}.sh" "$hookdir/initqueue${qname}/${job}.sh"
57 [ -z "$qname" ] && >> $hookdir/initqueue/work
58 exit 0