aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/rc')
-rwxr-xr-xrc.d/rc14
1 files changed, 8 insertions, 6 deletions
diff --git a/rc.d/rc b/rc.d/rc
index 40cf3188..33b6ed71 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -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
}