From 177fddcf7dc65a392ce0934ff6ed0616b41cd0ac Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Tue, 25 Feb 2025 02:55:52 +0000 Subject: [PATCH] Add warnings to hardware script (dd implies 'doubly dangerous') --- scripts/hardware.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/hardware.sh b/scripts/hardware.sh index 5070e47..cd03a7c 100755 --- a/scripts/hardware.sh +++ b/scripts/hardware.sh @@ -1,2 +1,24 @@ #!/bin/bash -sudo dd if=./build/image.iso of="$1" + +# Colors +GREEN='\033[0;32m' +BLUE='\033[0;34m' +YELLOW='\033[0;33m' +RED='\033[0;31m' +BOLD='\033[1m' +NC='\033[0m' # No Color + +info() { + echo -e "${BLUE}${BOLD}info${NC}: $1" +} + +warning() { + echo -e "${YELLOW}${BOLD}warning${NC}: $1" >&2 +} + +warning "This script will OVERWRITE whatever media you throw at it\nwith the built ISO." +info "sudo ./hardware.sh /dev/yourdisk" + +if echo "$1" | grep -q "/dev"; then + dd if=./build/image.iso of="$1" +fi