2019-10-04 12:55:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Prevent *.sh from returning itself if there are no matches
|
|
|
|
shopt -s nullglob
|
|
|
|
|
2019-10-04 14:11:47 +00:00
|
|
|
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
|
2019-10-04 14:11:47 +00:00
|
|
|
|
|
|
|
echo "network is now up, running scripts"
|
2019-10-04 12:55:40 +00:00
|
|
|
|
2019-10-04 14:11:47 +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
|
2019-10-04 14:11:47 +00:00
|
|
|
for FN in /boot/per-boot.d/*.sh ; do
|
|
|
|
echo "running '$FN'"
|
|
|
|
bash "$FN"
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|