diff --git a/dietpi/README.md b/dietpi/README.md index ac4ac7e6b..834186e9f 100644 --- a/dietpi/README.md +++ b/dietpi/README.md @@ -158,3 +158,6 @@ Allows you to automatically execute a custom script at the end of DietPi install Option 1 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically. Option 2 = Host your script online, then use AUTO_SETUP_CUSTOM_SCRIPT_EXEC=http://myweb.com/myscript.sh, it will be downloaded and executed automatically. | 0=disabled NB: Executed script log /var/tmp/dietpi/logs/dietpi-automation_custom_script.log + +### Guide to clone your SD-cards and shrink the image in linux: +https://beebom.com/how-clone-raspberry-pi-sd-card-windows-linux-macos/ \ No newline at end of file diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index c68a53aed..05c5e66f3 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -283,16 +283,16 @@ if [ ${configExists} -eq 1 ]; then source ${configFile} # update public IP on boot - # wait otherwise looking for publicIP fails - sleep 5 freshPublicIP=$(curl -s http://v4.ipv6-test.com/api/myip.php) if [ ${#freshPublicIP} -eq 0 ]; then - echo "WARNING: Was not able to determine external IP on startup." >> $logFile + echo "WARNING: Was not able to determine external IP on startup. Setting publicIP to local_ip" >> $logFile + local_ip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + sed -i "s/^publicIP=.*/publicIP=${local_ip}/g" ${configFile} else publicIPValueExists=$( sudo cat ${configFile} | grep -c 'publicIP=' ) if [ ${publicIPValueExists} -gt 1 ]; then # remove one - echo "more then one publiIp entry - removing one" >> $logFile + echo "more then one publicIp entry - removing one" >> $logFile sed -i "s/^publicIP=.*//g" ${configFile} publicIPValueExists=$( sudo cat ${configFile} | grep -c 'publicIP=' ) fi diff --git a/home.admin/assets/bootstrap.service b/home.admin/assets/bootstrap.service index c83db1fe6..11244a582 100644 --- a/home.admin/assets/bootstrap.service +++ b/home.admin/assets/bootstrap.service @@ -8,7 +8,7 @@ After=network.target [Service] User=root Group=root -Type=simple +Type=oneshot RemainAfterExit=true ExecStart=/home/admin/_bootstrap.sh StandardOutput=journal