Auto install option!

A external parameter to auto install without questions!
This commit is contained in:
luizoti 2020-03-07 12:59:10 -03:00 committed by GitHub
parent 27cd3d4da4
commit eb84f27919
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
#! /bin/bash
INPUT=$1
show_question() {
echo -e "\033[1;34m$@\033[0m"
}
@ -18,6 +20,14 @@ end() {
}
continue() {
case ${INPUT} in
'-a' )
:
;;
'-h' )
echo " -a - Auto-install for all users!"
;;
* )
show_question "\nDo you want to continue? (Y)es, (N)o : \n"
read INPUT
case $INPUT in
@ -25,6 +35,8 @@ continue() {
( [Nn]* ) end;;
( * ) show_error "\nSorry, try again."; continue;;
esac
;;
esac
}
replace() {
@ -35,6 +47,7 @@ replace() {
( [Nn]* ) ;;
( * ) show_error "\tSorry, try again."; replace $@;;
esac
}
install() {
@ -113,6 +126,14 @@ remove() {
}
main() {
case ${INPUT} in
'-a' )
install
;;
'-h' )
echo " -a - Auto-install for all users!"
;;
* )
show_question "What you want to do: (I)nstall, (R)emove : \n"
read INPUT
case $INPUT in
@ -120,6 +141,10 @@ main() {
( [Rr]* ) remove;;
( * ) show_error "\nSorry, try again."; main;;
esac
;;
esac
}
ROOT_UID=0