added support for multiple custom scripts by simply creating them in wz_mini/etc/rc.local.d

This commit is contained in:
Claude Meyer
2022-06-14 15:56:47 -05:00
parent 3dcece0b60
commit eacf29d905
5 changed files with 18 additions and 3 deletions

View File

@@ -609,7 +609,18 @@ if [ -f "$CUSTOM_SCRIPT_PATH" ]; then
echo "starting custom script"
$CUSTOM_SCRIPT_PATH &
else
echo "custom script not found"
echo "no custom script configured in wz_mini.conf"
fi
echo "searching for custom scripts in /opt/wz_mini/etc/rc.local.d"
if [ -d "${1:-/opt/wz_mini/etc/rc.local.d}" ] ; then
for filename in $(find /opt/wz_mini/etc/rc.local.d/ -name "*.sh" | /opt/wz_mini/bin/busybox sort) ; do
if [ -f "${filename}" ] && [ -x "${filename}" ]; then
echo "running ${filename}"
"${filename}"
fi
done
fi
echo "finished executing custom scripts from /opt/wz_mini/etc/rc.local.d"
echo "wz_user.sh done" > /dev/kmsg

View File