OSDN Git Service

allow changing instantarch location for askutils
authorpaperbenni <paperbenni@gmail.com>
Thu, 16 Jul 2020 09:26:34 +0000 (11:26 +0200)
committerpaperbenni <paperbenni@gmail.com>
Thu, 16 Jul 2020 09:26:34 +0000 (11:26 +0200)
askutils.sh

index 3f57ed6..28dcc13 100755 (executable)
@@ -4,6 +4,12 @@
 # like topinstall.sh
 
 # check if the install session is GUI or cli
+
+if [ -z "$INSTANTARCH" ]; then
+    echo "defaulting instantarch location to /root/instantARCH"
+    INSTANTARCH="/root/instantARCH"
+fi
+
 guimode() {
     if [ -e /opt/noguimode ]; then
         return 1
@@ -45,7 +51,7 @@ systemd-swap (obviously)" | imenu -M
 
 # ask for keyboard layout
 asklayout() {
-    cd /root/instantARCH/data/lang/keyboard
+    cd "$INSTANTARCH"/data/lang/keyboard
     while [ -z "$NEWKEY" ]; do
         wallstatus worldmap
         NEWKEY="$(ls | imenu -l 'Select keyboard layout ')"
@@ -79,7 +85,7 @@ $OTHERKEY" >/root/instantARCH/data/lang/keyboard/other
 
 # ask for default locale
 asklocale() {
-    cd /root/instantARCH/data/lang/locale
+    cd "$INSTANTARCH"/data/lang/locale
     while [ -z "$NEWLOCALE" ]; do
         NEWLOCALE="$(ls | imenu -l 'Select language> ')"
     done