]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
initqueue: first remove the job, then execute it
authorHarald Hoyer <harald@redhat.com>
Tue, 15 Sep 2009 09:10:36 +0000 (11:10 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 15 Sep 2009 13:00:24 +0000 (15:00 +0200)
modules.d/99base/initqueue

index 288d4f9a418591c2f99cce9061a02f02d73a5a0d..50c48defa1a5ac66de325468ec21a9b46350a701 100755 (executable)
@@ -25,9 +25,12 @@ else
        job=${job##*/}
 fi
 
-echo "$@" > "/tmp/${job}.sh"
 if [ -n "$onetime" ]; then
-   echo '[ -e "$job" ] && rm "$job"' >> "/tmp/${job}.sh"
+   echo '[ -e "$job" ] && rm "$job"' > "/tmp/${job}.sh"
+   echo "$@" >> "/tmp/${job}.sh"
+else
+   echo "$@" > "/tmp/${job}.sh"
 fi
+
 mv -f "/tmp/${job}.sh" /initqueue${settled}/
 [ -z "$settled" ] && >> /initqueue/work