Skip to content

Commit 5abcb47

Browse files
authored
Umbrel: Fix MachineType (#4810)
* Umbrel: Fix MachineType * Update umbrel-os-vm.sh * Update umbrel-os-vm.sh
1 parent 709a899 commit 5abcb47

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

vm/umbrel-os-vm.sh

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ MACADDRESS="${TAB}🔗${TAB}${CL}"
5050
VLANTAG="${TAB}🏷️${TAB}${CL}"
5151
CREATING="${TAB}🚀${TAB}${CL}"
5252
ADVANCED="${TAB}🧩${TAB}${CL}"
53+
5354
THIN="discard=on,ssd=1,"
5455
set -e
5556
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
@@ -60,8 +61,8 @@ function error_handler() {
6061
local exit_code="$?"
6162
local line_number="$1"
6263
local command="$2"
63-
post_update_to_api "failed" "${command}"
6464
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
65+
post_update_to_api "failed" "${command}"
6566
echo -e "\n$error_message\n"
6667
cleanup_vmid
6768
}
@@ -162,7 +163,7 @@ function ssh_check() {
162163
fi
163164
}
164165

165-
function exit_script() {
166+
function exit-script() {
166167
clear
167168
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
168169
exit
@@ -172,9 +173,9 @@ function default_settings() {
172173
VMID=$(get_valid_nextid)
173174
FORMAT=",efitype=4m"
174175
MACHINE=""
175-
DISK_CACHE=""
176176
DISK_SIZE="32G"
177-
HN="umbrel-os"
177+
DISK_CACHE=""
178+
HN="umbrelos"
178179
CPU_TYPE=""
179180
CORE_COUNT="2"
180181
RAM_SIZE="4096"
@@ -234,7 +235,7 @@ function advanced_settings() {
234235
MACHINE=""
235236
fi
236237
else
237-
exit_script
238+
exit-script
238239
fi
239240

240241
if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -246,10 +247,10 @@ function advanced_settings() {
246247
echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}$DISK_SIZE${CL}"
247248
else
248249
echo -e "${DISKSIZE}${BOLD}${RD}Invalid Disk Size. Please use a number (e.g., 10 or 10G).${CL}"
249-
exit_script
250+
exit-script
250251
fi
251252
else
252-
exit_script
253+
exit-script
253254
fi
254255

255256
if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
@@ -264,19 +265,19 @@ function advanced_settings() {
264265
DISK_CACHE=""
265266
fi
266267
else
267-
exit_script
268+
exit-script
268269
fi
269270

270-
if VM_NAME=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Hostname" 8 58 umbrel-os --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
271+
if VM_NAME=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Hostname" 8 58 umbrelos --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
271272
if [ -z $VM_NAME ]; then
272-
HN="umbrel-os"
273+
HN="umbrelos"
273274
echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}"
274275
else
275276
HN=$(echo ${VM_NAME,,} | tr -d ' ')
276277
echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}"
277278
fi
278279
else
279-
exit_script
280+
exit-script
280281
fi
281282

282283
if CPU_TYPE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \
@@ -291,7 +292,7 @@ function advanced_settings() {
291292
CPU_TYPE=""
292293
fi
293294
else
294-
exit_script
295+
exit-script
295296
fi
296297

297298
if CORE_COUNT=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate CPU Cores" 8 58 2 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -302,7 +303,7 @@ function advanced_settings() {
302303
echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}"
303304
fi
304305
else
305-
exit_script
306+
exit-script
306307
fi
307308

308309
if RAM_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate RAM in MiB" 8 58 2048 --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -313,7 +314,7 @@ function advanced_settings() {
313314
echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}$RAM_SIZE${CL}"
314315
fi
315316
else
316-
exit_script
317+
exit-script
317318
fi
318319

319320
if BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -324,7 +325,7 @@ function advanced_settings() {
324325
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
325326
fi
326327
else
327-
exit_script
328+
exit-script
328329
fi
329330

330331
if MAC1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a MAC Address" 8 58 $GEN_MAC --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -336,7 +337,7 @@ function advanced_settings() {
336337
echo -e "${MACADDRESS}${BOLD}${DGN}MAC Address: ${BGN}$MAC1${CL}"
337338
fi
338339
else
339-
exit_script
340+
exit-script
340341
fi
341342

342343
if VLAN1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -349,7 +350,7 @@ function advanced_settings() {
349350
echo -e "${VLANTAG}${BOLD}${DGN}VLAN: ${BGN}$VLAN1${CL}"
350351
fi
351352
else
352-
exit_script
353+
exit-script
353354
fi
354355

355356
if MTU1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then
@@ -362,7 +363,7 @@ function advanced_settings() {
362363
echo -e "${DEFAULT}${BOLD}${DGN}Interface MTU Size: ${BGN}$MTU1${CL}"
363364
fi
364365
else
365-
exit_script
366+
exit-script
366367
fi
367368

368369
if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "START VIRTUAL MACHINE" --yesno "Start VM when completed?" 10 58); then
@@ -393,13 +394,14 @@ function start_script() {
393394
advanced_settings
394395
fi
395396
}
397+
396398
check_root
397399
arch_check
398400
pve_check
399401
ssh_check
400402
start_script
401-
post_to_api_vm
402403

404+
post_to_api_vm
403405
msg_info "Validating Storage"
404406
while read -r line; do
405407
TAG=$(echo $line | awk '{print $1}')

0 commit comments

Comments
 (0)