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
51
install.sh
51
install.sh
|
@ -1,5 +1,7 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
INPUT=$1
|
||||||
|
|
||||||
show_question() {
|
show_question() {
|
||||||
echo -e "\033[1;34m$@\033[0m"
|
echo -e "\033[1;34m$@\033[0m"
|
||||||
}
|
}
|
||||||
|
@ -18,12 +20,22 @@ end() {
|
||||||
}
|
}
|
||||||
|
|
||||||
continue() {
|
continue() {
|
||||||
show_question "\nDo you want to continue? (Y)es, (N)o : \n"
|
case ${INPUT} in
|
||||||
read INPUT
|
'-a' )
|
||||||
case $INPUT in
|
:
|
||||||
( [Yy]* ) ;;
|
;;
|
||||||
( [Nn]* ) end;;
|
'-h' )
|
||||||
( * ) show_error "\nSorry, try again."; continue;;
|
echo " -a - Auto-install for all users!"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
show_question "\nDo you want to continue? (Y)es, (N)o : \n"
|
||||||
|
read INPUT
|
||||||
|
case $INPUT in
|
||||||
|
( [Yy]* ) ;;
|
||||||
|
( [Nn]* ) end;;
|
||||||
|
( * ) show_error "\nSorry, try again."; continue;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +47,7 @@ replace() {
|
||||||
( [Nn]* ) ;;
|
( [Nn]* ) ;;
|
||||||
( * ) show_error "\tSorry, try again."; replace $@;;
|
( * ) show_error "\tSorry, try again."; replace $@;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
|
@ -113,13 +126,25 @@ remove() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
show_question "What you want to do: (I)nstall, (R)emove : \n"
|
case ${INPUT} in
|
||||||
read INPUT
|
'-a' )
|
||||||
case $INPUT in
|
install
|
||||||
( [Ii]* ) install;;
|
;;
|
||||||
( [Rr]* ) remove;;
|
'-h' )
|
||||||
( * ) show_error "\nSorry, try again."; main;;
|
echo " -a - Auto-install for all users!"
|
||||||
esac
|
;;
|
||||||
|
* )
|
||||||
|
show_question "What you want to do: (I)nstall, (R)emove : \n"
|
||||||
|
read INPUT
|
||||||
|
case $INPUT in
|
||||||
|
( [Ii]* ) install;;
|
||||||
|
( [Rr]* ) remove;;
|
||||||
|
( * ) show_error "\nSorry, try again."; main;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOT_UID=0
|
ROOT_UID=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue