aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2002-07-10 08:58:44 +0000
committerFlorian La Roche <laroche@redhat.com>2002-07-10 08:58:44 +0000
commit78fd012ed58636caa076fa35b50c1001bb211b14 (patch)
tree88a047ed80881a968eaac176e5307599f3c217bf /rc.d/init.d
parent95ef94bed21f6812e2d879d354604c46b51b4016 (diff)
downloadinitscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.gz
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.bz2
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.xz
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.zip
- better checks for backup files
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/single13
1 files changed, 7 insertions, 6 deletions
diff --git a/rc.d/init.d/single b/rc.d/init.d/single
index df645e7e..64c6806d 100755
--- a/rc.d/init.d/single
+++ b/rc.d/init.d/single
@@ -29,15 +29,16 @@ fi
# If they want to run something in single user mode, might as well run it...
for i in /etc/rc1.d/S[0-9][0-9]* ; do
# Check if the script is there.
- [ -f "$i" ] || continue
+ [ -x "$i" ] || continue
- # Don't run [KS]??foo.{rpmsave,rpmorig} scripts
- [ "${i%.rpmsave}" != "$i" ] && continue
- [ "${i%.rpmorig}" != "$i" ] && continue
- [ "${i%.rpmnew}" != "$i" ] && continue
+ # Reject backup files and files generated by rpm.
+ case "$1" in
+ *.rpmsave|*.rpmorig|*.rpmnew|*~|*.orig)
+ continue;;
+ esac
[ "$i" = "/etc/rc1.d/S00single" ] && continue
$i start
-done
+done
# Now go to the single user level.
echo $"Telling INIT to go to single user mode."