hacks/fix-raspian-defaults/root.overlay/usr/lib/raspi-ini/run-parts.sh

29 lines
618 B
Bash
Raw Permalink Normal View History

2019-10-04 12:55:40 +00:00
#!/bin/bash
# Prevent *.sh from returning itself if there are no matches
shopt -s nullglob
exec 1> >(logger -s -t $(basename $0)) 2>&1
echo "waiting for network to come up..."
2019-10-04 15:10:07 +00:00
until ping -c1 -w1 www.google.com >/dev/null 2>&1; do :; done
echo "network is now up, running scripts"
2019-10-04 12:55:40 +00:00
# Run every per-once script
for FN in /boot/per-once.d/*.sh ; do
echo "running '$FN'"
bash "$FN" && \
echo "renaming $FN" && \
mv $FN $(dirname $FN)/$(basename $FN .sh).$(date +%F.%H.%M.%S)
2019-10-04 12:55:40 +00:00
done
# Run every per-boot script
for FN in /boot/per-boot.d/*.sh ; do
echo "running '$FN'"
bash "$FN"
done