blob: a8e2432bb6d2398bd8744eb4a94b42d114c62b83 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001#!/bin/sh
2# Copyright (C) 2017 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5EXEC_DIR=/exec.d # place to look for modules
6
7exec_enabled() {
8 return 0
9}
10
11exec_run() {
12 if [ ! -d $EXEC_DIR ]; then
13 msg "No contents to exec in $EXEC_DIR. Starting shell ..."
14 sh
15 fi
16
17 # Load and run modules
18 for m in $EXEC_DIR/*; do
19 # Skip backup files
20 if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
21 continue
22 fi
23
24 debug "Starting $m"
25
26 # process module
27 ./$m
28 done
29}