projects
/
grml-udev-config.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
88c4d80
)
Make sure to always clean up on exit.
author
Michael Prokop
<mika@grml.org>
Thu, 16 Dec 2010 16:45:08 +0000
(17:45 +0100)
committer
Michael Prokop
<mika@grml.org>
Thu, 16 Dec 2010 16:57:48 +0000
(17:57 +0100)
scripts/grml-udev-rebuildfstab
patch
|
blob
|
history
diff --git
a/scripts/grml-udev-rebuildfstab
b/scripts/grml-udev-rebuildfstab
index
53521c8
..
9181b74
100755
(executable)
--- a/
scripts/grml-udev-rebuildfstab
+++ b/
scripts/grml-udev-rebuildfstab
@@
-50,7
+50,7
@@
fi
if grep -q " nofstab" /proc/cmdline ; then
if grep -q " nofstab" /proc/cmdline ; then
- exit
+ bailout 0
fi
grep -q 'nolabel' /proc/cmdline && NOLABEL='TRUE' || LABEL='TRUE'
fi
grep -q 'nolabel' /proc/cmdline && NOLABEL='TRUE' || LABEL='TRUE'
@@
-58,13
+58,13
@@
grep -q 'nolabel' /proc/cmdline && NOLABEL='TRUE' || LABEL='TRUE'
if [ "$CONFIG_FSTAB" = "no" ] ; then
if [ "$CONFIG_FSTAB" = "no" ] ; then
- exit
+ bailout 0
fi
if grep -q ' /mnt ' /proc/mounts ; then
logit '/mnt is a mounted directory, exiting.'
fi
if grep -q ' /mnt ' /proc/mounts ; then
logit '/mnt is a mounted directory, exiting.'
-
exi
t 1
+
bailou
t 1
fi
# make sure we have the $MNTFILE before reading/writing into it
fi
# make sure we have the $MNTFILE before reading/writing into it
@@
-106,7
+106,7
@@
fi
[ ! -w /etc/fstab ] && {
logit "fatal - /etc/fstab not writeable, exiting"
[ ! -w /etc/fstab ] && {
logit "fatal - /etc/fstab not writeable, exiting"
- exit
+ bailout 0
}
# Simple shell grep, searches for lines STARTING with string
}
# Simple shell grep, searches for lines STARTING with string
@@
-185,13
+185,13
@@
fi
if [ -z "$ACTION" ] ; then
logit "Seems that $0 is not run in a udev environment, exiting." >&2
if [ -z "$ACTION" ] ; then
logit "Seems that $0 is not run in a udev environment, exiting." >&2
-
exi
t 1
+
bailou
t 1
fi
# ignore loop devices for now.
case $DEVNAME in
/dev/loop*)
fi
# ignore loop devices for now.
case $DEVNAME in
/dev/loop*)
-
exi
t 0
+
bailou
t 0
;;
esac
;;
esac
@@
-209,11
+209,11
@@
mountpoint=$(get_mount_point $device)
for devicelink in $DEVLINKS ; do
# ignore external
case "$devicelink" in "*external*") continue ;; esac
for devicelink in $DEVLINKS ; do
# ignore external
case "$devicelink" in "*external*") continue ;; esac
- stringinfile $devicelink $TMPFILE &&
exit
+ stringinfile $devicelink $TMPFILE &&
bailout 0
done
# if entry is already present ignore it
done
# if entry is already present ignore it
-stringinfile $device $TMPFILE &&
exit
+stringinfile $device $TMPFILE &&
bailout 0
options=noauto,user,dev,suid,exec
case $ID_FS_TYPE in
options=noauto,user,dev,suid,exec
case $ID_FS_TYPE in
@@
-278,4
+278,6
@@
if [ -r "$MNTFILE" ] ; then
cat $TMPFILE > $MNTFILE
fi
cat $TMPFILE > $MNTFILE
fi
+bailout 0
+
## END OF FILE #################################################################
## END OF FILE #################################################################