added extras menu functions into install
This commit is contained in:
parent
426caaade7
commit
4b3da346bc
1 changed files with 25 additions and 22 deletions
47
install.sh
47
install.sh
|
|
@ -11,8 +11,10 @@ scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
|
||||||
scriptname="${BASH_SOURCE[0]##*/}"
|
scriptname="${BASH_SOURCE[0]##*/}"
|
||||||
rundir="${BASH_SOURCE[0]%/*}"
|
rundir="${BASH_SOURCE[0]%/*}"
|
||||||
|
|
||||||
|
|
||||||
# Source PRbL functions from installer directory
|
# Source PRbL functions from installer directory
|
||||||
source ${rundir}/functions
|
source ${rundir}/functions
|
||||||
|
rundir_absolute=$(pushd $rundir ; pwd ; popd)
|
||||||
|
|
||||||
#-----------------------------------------------------------------#
|
#-----------------------------------------------------------------#
|
||||||
# Script-specific Parameters
|
# Script-specific Parameters
|
||||||
|
|
@ -286,8 +288,8 @@ install-dir() {
|
||||||
|
|
||||||
install-extras(){
|
install-extras(){
|
||||||
_extras=()
|
_extras=()
|
||||||
for file in ${rundir_absolute}/extras/*.install ; do
|
for file in $(ls ${rundir}/extras/*.install) ; do
|
||||||
_extras+=("${rundir_absolute}/extras/$file.install")
|
_extras+=("$file")
|
||||||
done
|
done
|
||||||
|
|
||||||
boxborder "Which extras should be installed?"
|
boxborder "Which extras should be installed?"
|
||||||
|
|
@ -303,6 +305,23 @@ install-extras(){
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extras-menu(){
|
||||||
|
# Download and install any other extras
|
||||||
|
#if [ -d "${rundir_absolute}/extras/" ] ; then
|
||||||
|
boxborder "Extra installs available. Select and install?"
|
||||||
|
extras_menu=(
|
||||||
|
"$(boxline "${green_check} Yes")"
|
||||||
|
"$(boxline "${red_x} No")"
|
||||||
|
)
|
||||||
|
case `select_opt "${extras_menu[@]}"` in
|
||||||
|
0) boxborder "${grn}Installing extras...${dfl}"
|
||||||
|
install-extras
|
||||||
|
;;
|
||||||
|
1) logger "Skipping extras installs" ;;
|
||||||
|
esac
|
||||||
|
#fi
|
||||||
|
}
|
||||||
|
|
||||||
# install-dir(){
|
# install-dir(){
|
||||||
# local _source="$1"
|
# local _source="$1"
|
||||||
# local _destination="$2"
|
# local _destination="$2"
|
||||||
|
|
@ -382,19 +401,7 @@ userinstall(){
|
||||||
#fi
|
#fi
|
||||||
#clear
|
#clear
|
||||||
|
|
||||||
# Download and install any other extras
|
extras-menu
|
||||||
if [ -d "${rundir_absolute}/extras/" ] ; then
|
|
||||||
extras_menu=(
|
|
||||||
"$(boxline "${green_check} Yes")"
|
|
||||||
"$(boxline "${red_x} No")"
|
|
||||||
)
|
|
||||||
case `select_opt "${extras_menu[@]}"` in
|
|
||||||
0) boxborder "${grn}Installing extras...${dfl}"
|
|
||||||
install-extras
|
|
||||||
;;
|
|
||||||
1) logger "Skipping extras installs" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [[ $dry_run != true ]] ; then
|
if [[ $dry_run != true ]] ; then
|
||||||
boxborder "${grn}Please be sure to run ${lyl}sensors-detect --auto${grn} after installation completes${dfl}"
|
boxborder "${grn}Please be sure to run ${lyl}sensors-detect --auto${grn} after installation completes${dfl}"
|
||||||
fi
|
fi
|
||||||
|
|
@ -463,11 +470,7 @@ globalinstall(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download and install any other extras
|
# Download and install any other extras
|
||||||
if [ -f "${rundir_absolute}/extras/*.install" ] ; then
|
extras-menu
|
||||||
for file in ${rundir_absolute}/extras/*.install ; do
|
|
||||||
run /bin/bash "${rundir_absolute}/extras/$file"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
#clear
|
#clear
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -551,12 +554,12 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
-D | --dry-run)
|
-D | --dry-run)
|
||||||
export dry_run=true
|
export dry_run=true
|
||||||
box-light
|
box-double
|
||||||
boxtop
|
boxtop
|
||||||
install
|
install
|
||||||
boxbottom
|
boxbottom
|
||||||
dry-run-report
|
dry-run-report
|
||||||
usage
|
usage
|
||||||
unset dry_run
|
unset dry_run
|
||||||
success "${red}P${lrd}R${ylw}b${ong}L${dfl} Dry-Run Complete!"
|
success "${red}P${lrd}R${ylw}b${ong}L${dfl} Dry-Run Complete!"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue