project:build.sh:Add support for multiple folders in post overlay project:cfg:BoardConfig_IPC:Add support for rootfs post overlay sysdrv:Makefile:Replace the script-based copying method with the post overlay approach Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
56 lines
777 B
Bash
Executable File
56 lines
777 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# python Starts python code.
|
|
#
|
|
|
|
# Make sure the python progam exists
|
|
[ -f /usr/bin/python ] || exit 0
|
|
|
|
umask 077
|
|
|
|
main_path="/root/main.py"
|
|
boot_path="/root/boot.py"
|
|
|
|
start() {
|
|
# Run python progam
|
|
if [ -f $main_path ]; then
|
|
echo "running $main_path..."
|
|
python $main_path
|
|
else
|
|
if [ -f $boot_path ]; then
|
|
echo "running $boot_path..."
|
|
python $boot_path
|
|
else
|
|
echo "$main_path and $boot_path not exist ,pass..."
|
|
fi
|
|
fi
|
|
echo "OK"
|
|
}
|
|
stop() {
|
|
printf "Stopping python: "
|
|
killall python
|
|
echo "OK"
|
|
}
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|
|
|