diff options
author | Maxim Devaev <[email protected]> | 2021-11-08 04:25:29 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-11-08 04:25:29 +0300 |
commit | fde4539e36f332cc208d4201b02f00eb4a3d8089 (patch) | |
tree | d592e0823f2e0f9ff30733ca225924e3336b6225 /scripts | |
parent | 6f56c40436ee2fc032069a6618c4d3cad7920665 (diff) |
pikvm/pikvm#73: run custom bootconfig scripts from /etc/kvmd/bootconfig.d
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kvmd-bootconfig | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/kvmd-bootconfig b/scripts/kvmd-bootconfig index d22d1845..98bcb4a4 100755 --- a/scripts/kvmd-bootconfig +++ b/scripts/kvmd-bootconfig @@ -92,7 +92,7 @@ TTYVHangup=no TTYVTDisallocate=no end_of_file systemctl enable [email protected] - REBOOT=1 + touch /boot/pikvm-reboot.txt fi @@ -130,16 +130,23 @@ ClientIdentifier=mac end_of_file wpa_passphrase "$WIFI_ESSID" "$WIFI_PASSWD" > "/etc/wpa_supplicant/wpa_supplicant-$WIFI_IFACE.conf" systemctl enable "wpa_supplicant@$WIFI_IFACE.service" || true - REBOOT=1 + touch /boot/pikvm-reboot.txt fi +# ========== Custom scripts ========== +for script in `ls /etc/kvmd/bootconfig.d | sort`; do + /etc/kvmd/bootconfig.d/"$script" || true +done + + # ========== Finish ========== rm -f /boot/pikvm.txt ro -if [ -n "$REBOOT" ]; then +if [ -f /boot/pikvm-reboot.txt ]; then + rm -f /boot/pikvm-reboot.txt echo "kvmd-bootconfig: Reboot after 5 seconds" | tee /dev/kmsg sleep 2 reboot |