summaryrefslogtreecommitdiff
path: root/apps/installer/main.sh
diff options
context:
space:
mode:
Diffstat (limited to 'apps/installer/main.sh')
-rw-r--r--apps/installer/main.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/apps/installer/main.sh b/apps/installer/main.sh
new file mode 100644
index 0000000000..a71bca1996
--- /dev/null
+++ b/apps/installer/main.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+
+CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+source "$CURRENT_PATH/includes/includes.sh"
+
+cmdopt=$1
+
+while true
+do
+echo "===== INSTALLER SCRIPT ====="
+PS3='Please enter your choice: '
+options=(
+ "First Installation" "Configure OS dep" "Update Repository" "Reset & Clean Repository"
+ "Compile" "Clean & Compile" "Assemble & Import DB" "Module Search" "Module Install" "Module Update" "Module Remove"
+ "Sub Menu >> Compiler" "Sub Menu >> DB Assembler"
+ "Quit"
+ )
+
+function _switch() {
+ case $1 in
+ "First Installation")
+ inst_allInOne
+ ;;
+ "Configure OS dep")
+ inst_configureOS
+ ;;
+ "Update Repository")
+ inst_updateRepo
+ ;;
+ "Reset & Clean Repository")
+ inst_resetRepo
+ ;;
+ "Compile")
+ inst_compile
+ ;;
+ "Clean & Compile")
+ inst_cleanCompile
+ ;;
+ "Assemble & Import DB")
+ inst_assembleDb
+ ;;
+ "Module Search")
+ inst_module_search $2
+ ;;
+ "Module Install")
+ inst_module_install $2
+ ;;
+ "Module Update")
+ inst_module_update $2
+ ;;
+ "Module Remove")
+ inst_module_remove $2
+ ;;
+ "Sub Menu >> Compiler")
+ bash "$AC_PATH_BIN/compiler/compiler.sh"
+ ;;
+ "Sub Menu >> DB Assembler")
+ bash "$AC_PATH_BIN/db_assembler/db_assembler.sh"
+ ;;
+ "Quit")
+ echo "Goodbye!"
+ exit
+ ;;
+ *) echo invalid option;;
+ esac
+}
+
+# run option directly if specified in argument
+[ ! -z $1 ] && _switch "${options[$cmdopt-1]}" && exit 0
+
+select opt in "${options[@]}"
+do
+ _switch "$opt"
+ break
+done
+done