summaryrefslogtreecommitdiffstats
path: root/defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry
diff options
context:
space:
mode:
Diffstat (limited to 'defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry')
-rw-r--r--defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry21
1 files changed, 21 insertions, 0 deletions
diff --git a/defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry b/defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry
new file mode 100644
index 0000000..c5e982c
--- /dev/null
+++ b/defaultenv/defaultenv-2-menu/menu/boot-menu-new-boot-entry
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+name=
+
+readline "Name of the new entry: " name
+
+if [ -z "$name" ]; then
+ exit 1
+fi
+
+if [ -e "/env/boot/$name" ]; then
+ echo "entry $name already exists"
+ readline "<enter>" unused
+ exit 1
+fi
+
+cp /env/data/boot-template /env/boot/$name
+
+edit /env/boot/$name
+
+boot-menu-show rebuild