1- #! /bin/sh
1+ #! /bin/bash
22<< \EOF
33<!DOCTYPE html>
4+ <!--
5+ Oh nice, you read the source code!
6+ Below is an HTML document, that you can ignore
7+ [continued on the other side of the document]
8+ -->
49<html lang="en">
510<head>
611 <meta charset="UTF-8">
@@ -89,7 +94,9 @@ <h2>Need Help?</h2>
8994</html>
9095<!--
9196EOF
92- # Function to check if a command exists
97+ # This script does 5 things:
98+ # 1. Search for git, make, arch-chroot, and python3, to ensure that this script works
99+ # [continued below]
93100check_command () {
94101 local cmd=" $1 "
95102 local extra_msg=" $2 "
@@ -99,35 +106,38 @@ <h2>Need Help?</h2>
99106 exit 1
100107 fi
101108}
109+
110+ check_command git
111+ check_command make
112+ check_command python3
113+ check_command arch-chroot
114+ check_command tput
115+
102116
103- # Check for root
117+ # 2. Check for root
104118if [[ $EUID -ne 0 ]]; then
105119 echo " This script must be run as root."
106120 echo " Attempting to run with sudo....."
107121 exec sudo -- bash -c " $( curl -fsSL https://ba.sh/ARbs) "
108122fi
109123
110- # Check for needed commands
111- check_command git
112- check_command make
113- check_command python3
114- check_command mktemp
115124
116- # Make temporary directory
125+ # 3. Make a temporary directory...
117126TMPDIR=" /tmp" # was something else but then obsidian-wizard would not like it
118-
119- clear
127+ tput smcup
120128echo " Starting ARbs, the ARch image Based inStaller..."
121129echo " Bootstrapping obsidianctl and obsidian-wizard into /tmp..."
130+ # ... and clean it up from previous usage
122131rm " $TMPDIR /obsidian*" " /tmp/mkobsidiansfs" -rf|| true
123- # Clone and prepare obsidian-wizard and obsidianctl
132+
133+ # 4. Clone and prepare obsidian-wizard and obsidianctl
124134git clone https://github.com/Obsidian-OS/obsidian-wizard " $TMPDIR /obsidian-wizard"
125135git clone https://github.com/Obsidian-OS/obsidianctl " $TMPDIR /obsidianctl"
126136bash -c " cd /$TMPDIR /obsidianctl;make"
127137chmod u+x " $TMPDIR /obsidian-wizard/obsidian-wizard.py"
128138
129- # Run script
139+ # 5. Run the wizard
130140echo " Starting ARbs, the ARch image Based inStaller..."
131141" $TMPDIR /obsidian-wizard/obsidian-wizard.py"
132- clear
142+ tput rmcup
133143echo " Thanks for using ARbs, the ARch image Based inStaller!"
0 commit comments