refactored prbl bashrc out as separate file
This commit is contained in:
parent
8648136661
commit
73b5f8b781
1 changed files with 7 additions and 4 deletions
11
install.sh
11
install.sh
|
|
@ -78,8 +78,7 @@ install(){
|
||||||
if [[ $runuser == root ]] ; then
|
if [[ $runuser == root ]] ; then
|
||||||
installdir="${globalinstalldir}"
|
installdir="${globalinstalldir}"
|
||||||
bashrc_append="
|
bashrc_append="
|
||||||
# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
# Pluggable bashrc config. Add environment modifications to ~/.bashrc.d/ and append with '.bashrc'
|
||||||
export prbl_functions=\"${installdir}/functions\"
|
|
||||||
if [ -n \"\$BASH_VERSION\" ]; then
|
if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
# include .bashrc if it exists
|
# include .bashrc if it exists
|
||||||
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
||||||
|
|
@ -89,12 +88,13 @@ if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
"
|
"
|
||||||
|
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
|
export prbl_functions=\"${installdir}/functions\""
|
||||||
globalinstall
|
globalinstall
|
||||||
else
|
else
|
||||||
installdir="${userinstalldir}"
|
installdir="${userinstalldir}"
|
||||||
bashrc_append="
|
bashrc_append="
|
||||||
# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
# Pluggable bashrc config. Add environment modifications to ~/.bashrc.d/ and append with '.bashrc'
|
||||||
export prbl_functions=\"${installdir}/functions\"
|
|
||||||
if [ -n \"\$BASH_VERSION\" ]; then
|
if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
# include .bashrc if it exists
|
# include .bashrc if it exists
|
||||||
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
||||||
|
|
@ -104,6 +104,8 @@ if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
"
|
"
|
||||||
|
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
|
export prbl_functions=\"${installdir}/functions\""
|
||||||
userinstall
|
userinstall
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -145,6 +147,7 @@ userinstall(){
|
||||||
# Check for existing bashrc config, append if missing
|
# Check for existing bashrc config, append if missing
|
||||||
if [[ $(cat ${HOME}/.bashrc | grep -c prbl) = 0 ]] ; then
|
if [[ $(cat ${HOME}/.bashrc | grep -c prbl) = 0 ]] ; then
|
||||||
echo -e "$bashrc_append" >> $HOME/.bashrc && boxborder "bashc.d installed..." || warn "Malformed append on ${lbl}${HOME}/.bashrc${dfl}. Check this file for errors"
|
echo -e "$bashrc_append" >> $HOME/.bashrc && boxborder "bashc.d installed..." || warn "Malformed append on ${lbl}${HOME}/.bashrc${dfl}. Check this file for errors"
|
||||||
|
echo -e "$prbl_bashrc" >> $HOME/.bashrc.d/00-prbl.bashrc && boxborder "bashc.d/00-prbl installed..." || warn "Malformed append on ${lbl}${HOME}/.bashrc.d/00-prbl.bashrc${dfl}. Check this file for errors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check crontab for quickinfo cron task
|
# Check crontab for quickinfo cron task
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue