From c49391d05aeefcb55d47c80adcf9685eef08ddd1 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 26 Mar 2021 03:04:21 -0600 Subject: [PATCH] Update clock under live macOS env --- setup/macos/live-macos-startup | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup/macos/live-macos-startup b/setup/macos/live-macos-startup index f6c7a043..ac0f2b93 100755 --- a/setup/macos/live-macos-startup +++ b/setup/macos/live-macos-startup @@ -7,6 +7,7 @@ LC_ALL=en_US.UTF-8; export LC_ALL LANG=en_US.UTF-8; export LANG # Set PATH +echo "Updating PATH..." for p in /usr{/local/opt/{e2fsprogs,ruby,util-linux},/local,}/{bin,sbin}; do PATH="${p}:${PATH}" done @@ -14,12 +15,21 @@ export PATH # Create and mount RAMDisk if ! [ -d /Volumes/RAM_Disk ]; then + echo "Creating RAM Disk..." diskutil erasevolume HFS+ RAM_Disk $(hdiutil attach -nomount ram://524288) fi cd /Volumes/RAM_Disk # Stay awake +echo "Getting caffeinated..." caffeinate -id & +# Set time +echo "Updating clock..." +if ! sntp -Ss us.pool.ntp.org 2>/dev/null; then + # Assuming we're running under an older version of macOS + sntp -s us.pool.ntp.org 2>/dev/null +fi + # Run cmd "$1"