-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLinux.sh
More file actions
25 lines (20 loc) · 778 Bytes
/
Linux.sh
File metadata and controls
25 lines (20 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Set variables
HA_OS_URL="https://ota.hasscn.top/16.3/haos_generic-x86-64-16.3.img.xz" # Replace with the actual URL of the Home Assistant OS image
TARGET_DISK="/dev/sda" # Modify this to your target disk path
# Ensure running as root
if [ "$(id -u)" -ne 0 ]; then
echo "Please run this script as root!"
exit 1
fi
# Download and write image to disk directly
echo "Downloading and writing Home Assistant OS image to $TARGET_DISK..."
wget -qO- "$HA_OS_URL" | xz -d | dd of="$TARGET_DISK" bs=1M status=progress iflag=fullblock oflag=direct
if [ $? -ne 0 ]; then
echo "Failed to write image! Please check the disk path or environment."
exit 1
fi
# Sync buffers
sync
echo "Home Assistant OS installation completed! The system will reboot now."
reboot