[PATCH 1/2] custom_scripts: check that scripts are executable early on

martin.langhoff at gmail.com martin.langhoff at gmail.com
Tue Feb 22 17:26:17 EST 2011


From: Martin Langhoff <martin at laptop.org>

---
 .../custom_scripts/prepare.20.custom_scripts.sh    |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 modules/custom_scripts/prepare.20.custom_scripts.sh

diff --git a/modules/custom_scripts/prepare.20.custom_scripts.sh b/modules/custom_scripts/prepare.20.custom_scripts.sh
new file mode 100644
index 0000000..6bd35da
--- /dev/null
+++ b/modules/custom_scripts/prepare.20.custom_scripts.sh
@@ -0,0 +1,20 @@
+# Copyright (C) 2009 One Laptop Per Child
+# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
+
+. $OOB__shlib
+
+oIFS=$IFS
+IFS=$'\n'
+BADSCRIPT='false'
+for line in $(env); do
+	[[ "${line:0:34}" == "CFG_custom_scripts__custom_script_" ]] || continue
+	script=${line#*=}
+	if [ ! -x $script ]; then
+	    BADSCRIPT='yes'
+	    echo "$script is not executable" 
+	fi
+done
+if [ "$BADSCRIPT" = 'yes' ];then
+    exit 1
+fi
+IFS=$oIFS
-- 
1.6.2.5




More information about the Devel mailing list