]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Don't add interpreters for files that are not executeable.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Sep 2010 17:55:33 +0000 (19:55 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Sep 2010 17:55:33 +0000 (19:55 +0200)
tools/functions-files

index 1d306c8b692dde6894dd1242a8f82191acbd81f8..41ce3be0cd748e620f6ac6250f3f934a508f4861 100644 (file)
@@ -45,6 +45,9 @@ function _file_get_elf_interpreter() {
 function _file_get_script_interpreter() {
        local file=${1}
 
+       # If the file is not executeable, no interpreter will be needed
+       [ -x "${file}" ] || return
+
        local first_line=$(head -n1 ${file})
 
        first_line="${first_line:2:${#first_line}}"