mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-28 14:04:22 -04:00
Auto install option!
A external parameter to auto install without questions!
This commit is contained in:
parent
27cd3d4da4
commit
eb84f27919
1 changed files with 38 additions and 13 deletions
25
install.sh
25
install.sh
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue