Merge branch 'master' of github.com:pyr0ball/PRbL-bashrc
This commit is contained in:
commit
3cf34b262a
2 changed files with 42 additions and 29 deletions
2
PRbL
2
PRbL
|
|
@ -1 +1 @@
|
||||||
Subproject commit 86c10738ce34063d4abb2bcb037b4da7139f21e3
|
Subproject commit f714911ae0c0d7c97351fae95b7f17a41b4c5b75
|
||||||
69
install.sh
69
install.sh
|
|
@ -4,7 +4,7 @@
|
||||||
###################################################################
|
###################################################################
|
||||||
|
|
||||||
# initial vars
|
# initial vars
|
||||||
VERSION=2.3.0
|
VERSION=2.3.3
|
||||||
scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
|
scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
|
||||||
|
|
||||||
# Bash expansions to get the name and location of this script when run
|
# Bash expansions to get the name and location of this script when run
|
||||||
|
|
@ -175,18 +175,6 @@ check-deps(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
install-deps(){
|
|
||||||
boxborder "Installing packages $packages"
|
|
||||||
if [[ dry_run == true ]] ; then
|
|
||||||
boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\""
|
|
||||||
else
|
|
||||||
# using a spinner function block to track installation progress
|
|
||||||
spin "for $_package in $packages ; do sudo apt-get install -y $_package ; done"
|
|
||||||
fi
|
|
||||||
# Sets dependency installed flag to true
|
|
||||||
depsinstalled=true
|
|
||||||
}
|
|
||||||
|
|
||||||
install(){
|
install(){
|
||||||
# If script is run as root, run global install
|
# If script is run as root, run global install
|
||||||
if [[ $runuser == root ]] ; then
|
if [[ $runuser == root ]] ; then
|
||||||
|
|
@ -203,6 +191,16 @@ export prbl_functions=\"${installdir}/functions\""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install-functions(){
|
||||||
|
# Copy functions
|
||||||
|
if [ -f ${rundir}/PRbL/functions ] ; then
|
||||||
|
install-file ${rundir}/PRbL/functions ${installdir}
|
||||||
|
else
|
||||||
|
curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/master/functions' > ${rundir}/functions
|
||||||
|
install-file ${rundir}/functions ${installdir}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
take-backup(){
|
take-backup(){
|
||||||
name="$1"
|
name="$1"
|
||||||
if [[ $update_run != true ]] ; then
|
if [[ $update_run != true ]] ; then
|
||||||
|
|
@ -279,6 +277,20 @@ install-dir() {
|
||||||
done < <(find "$_source" -type f -print0)
|
done < <(find "$_source" -type f -print0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install-deps(){
|
||||||
|
boxborder "Installing packages $packages"
|
||||||
|
if [[ dry_run != true ]] ; then
|
||||||
|
# using a spinner function block to track installation progress
|
||||||
|
for _package in $packages ; do
|
||||||
|
sudo apt-get install -y $_package
|
||||||
|
done
|
||||||
|
else
|
||||||
|
boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\""
|
||||||
|
fi
|
||||||
|
# Sets dependency installed flag to true
|
||||||
|
depsinstalled=true
|
||||||
|
}
|
||||||
|
|
||||||
install-extras(){
|
install-extras(){
|
||||||
_extras=()
|
_extras=()
|
||||||
extra_installs=$(ls ${escape_dir}/extras/)
|
extra_installs=$(ls ${escape_dir}/extras/)
|
||||||
|
|
@ -317,13 +329,13 @@ extras-menu(){
|
||||||
0) boxborder "${grn}Installing extras...${dfl}"
|
0) boxborder "${grn}Installing extras...${dfl}"
|
||||||
install-extras
|
install-extras
|
||||||
;;
|
;;
|
||||||
1) logger boxline "Skipping extras installs" ;;
|
1) boxline "Skipping extras installs" ;;
|
||||||
esac
|
esac
|
||||||
#fi
|
#fi
|
||||||
}
|
}
|
||||||
|
|
||||||
userinstall(){
|
userinstall(){
|
||||||
|
# TODO: modify this function to accept a user as an argument and call it from globalinstall
|
||||||
# Create install directory under user's home directory
|
# Create install directory under user's home directory
|
||||||
run mkdir -p ${installdir}
|
run mkdir -p ${installdir}
|
||||||
|
|
||||||
|
|
@ -337,7 +349,7 @@ userinstall(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy functions first
|
# Copy functions first
|
||||||
install-file ${rundir}/PRbL/functions ${installdir}
|
install-functions
|
||||||
|
|
||||||
# Copy bashrc scripts to home folder
|
# Copy bashrc scripts to home folder
|
||||||
install-dir ${rundir}/lib/skel/ $HOME
|
install-dir ${rundir}/lib/skel/ $HOME
|
||||||
|
|
@ -345,9 +357,9 @@ userinstall(){
|
||||||
# Check for dependent applications and warn user if any are missing
|
# Check for dependent applications and warn user if any are missing
|
||||||
if ! check-deps ; then
|
if ! check-deps ; then
|
||||||
warn "Some of the utilities needed by this script are missing"
|
warn "Some of the utilities needed by this script are missing"
|
||||||
echo -e "Missing utilities:"
|
boxlinelog "Missing utilities:"
|
||||||
echo -e "${bins_missing[@]}"
|
boxlinelog "${bins_missing[@]}"
|
||||||
echo -e "After this installer completes, run:"
|
boxlinelog "After this installer completes, run:"
|
||||||
boxseparator
|
boxseparator
|
||||||
echo -en "\n${lbl}sudo apt install -y ${bins_missing[@]}\n${dfl}"
|
echo -en "\n${lbl}sudo apt install -y ${bins_missing[@]}\n${dfl}"
|
||||||
boxborder "Press 'Enter' key when ready to proceed"
|
boxborder "Press 'Enter' key when ready to proceed"
|
||||||
|
|
@ -359,7 +371,7 @@ userinstall(){
|
||||||
|
|
||||||
# If vim is installed, add config files for colorization and expandtab
|
# If vim is installed, add config files for colorization and expandtab
|
||||||
if [[ $viminstall != null ]] ; then
|
if [[ $viminstall != null ]] ; then
|
||||||
mkdir -p ${HOME}/.vim/colors
|
run mkdir -p ${HOME}/.vim/colors
|
||||||
install-file $rundir/lib/vimfiles/crystallite.vim ${HOME}/.vim/colors
|
install-file $rundir/lib/vimfiles/crystallite.vim ${HOME}/.vim/colors
|
||||||
take-backup $HOME/.vimrc
|
take-backup $HOME/.vimrc
|
||||||
cp $rundir/lib/vimfiles/vimrc.local $rundir/lib/vimfiles/.vimrc
|
cp $rundir/lib/vimfiles/vimrc.local $rundir/lib/vimfiles/.vimrc
|
||||||
|
|
@ -385,7 +397,9 @@ userinstall(){
|
||||||
#fi
|
#fi
|
||||||
#clear
|
#clear
|
||||||
|
|
||||||
|
# launch extra installs
|
||||||
extras-menu
|
extras-menu
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -393,25 +407,24 @@ userinstall(){
|
||||||
|
|
||||||
globalinstall(){
|
globalinstall(){
|
||||||
# Create global install directory
|
# Create global install directory
|
||||||
run mkdir -p ${globalinstalldir}
|
run mkdir -p ${installdir}
|
||||||
|
|
||||||
# Copy functions
|
install-functions
|
||||||
install-file ${rundir}/PRbL/functions ${globalinstalldir}/functions
|
|
||||||
export prbl_functions="${globalinstalldir}/functions"
|
export prbl_functions="${globalinstalldir}/functions"
|
||||||
|
|
||||||
# Check for dependent applications and offer to install
|
# Check for dependent applications and offer to install
|
||||||
if ! check-deps ; then
|
if ! check-deps ; then
|
||||||
warn "Some of the utilities needed by this script are missing"
|
warn "Some of the utilities needed by this script are missing"
|
||||||
logger "Missing utilities:"
|
boxlinelog "Missing utilities:"
|
||||||
logger "${bins_missing[@]}"
|
boxlinelog "${bins_missing[@]}"
|
||||||
logger "Would you like to install them? (this will require root password)"
|
boxlinelog "Would you like to install them? (this will require root password)"
|
||||||
utilsmissing_menu=(
|
utilsmissing_menu=(
|
||||||
"$(boxline "${green_check} Yes")"
|
"$(boxline "${green_check} Yes")"
|
||||||
"$(boxline "${red_x} No")"
|
"$(boxline "${red_x} No")"
|
||||||
)
|
)
|
||||||
case `select_opt "${utilsmissing_menu[@]}"` in
|
case `select_opt "${utilsmissing_menu[@]}"` in
|
||||||
0) boxborder "${grn}Installing dependencies...${dfl}"
|
0) boxlinelog "${grn}Installing dependencies...${dfl}"
|
||||||
spin $(install-deps)
|
install-deps
|
||||||
;;
|
;;
|
||||||
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue