diff options
author | Florian La Roche <laroche@redhat.com> | 2002-07-10 08:58:44 +0000 |
---|---|---|
committer | Florian La Roche <laroche@redhat.com> | 2002-07-10 08:58:44 +0000 |
commit | 78fd012ed58636caa076fa35b50c1001bb211b14 (patch) | |
tree | 88a047ed80881a968eaac176e5307599f3c217bf /rc.d/rc | |
parent | 95ef94bed21f6812e2d879d354604c46b51b4016 (diff) | |
download | initscripts-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/rc')
-rwxr-xr-x | rc.d/rc | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -10,13 +10,15 @@ # check a file to be a correct runlevel script check_runlevel () { - # Check if the script is there. - [ -f "$1" ] || return 1 + # Check if the file exists at all. + [ -x "$1" ] || return 1 - # Don't run [KS]??foo.{rpmsave,rpmorig} scripts - [ "${1%.rpmsave}" != "$1" ] && return 1 - [ "${1%.rpmorig}" != "$1" ] && return 1 - [ "${1%.rpmnew}" != "$1" ] && return 1 + # Reject backup files and files generated by rpm. + case "$1" in + *.rpmsave|*.rpmorig|*.rpmnew|*~|*.orig) + return 1 + ;; + esac return 0 } |