fixed bashrc_append
This commit is contained in:
parent
341d8eb86a
commit
b1f2048717
1 changed files with 25 additions and 14 deletions
39
install.sh
39
install.sh
|
|
@ -18,19 +18,6 @@ globalinstalldir="/usr/share/prbl"
|
||||||
# Script-specific Parameters
|
# Script-specific Parameters
|
||||||
#-----------------------------------------------------------------#
|
#-----------------------------------------------------------------#
|
||||||
|
|
||||||
read -r -d bashrc_append << EOF
|
|
||||||
# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
|
||||||
export prbl_functions="${installdir}/functions"
|
|
||||||
if [ -n \"\$BASH_VERSION\" ]; then
|
|
||||||
# include .bashrc if it exists
|
|
||||||
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
|
||||||
for file in \$HOME/.bashrc.d/*.bashrc ; do
|
|
||||||
source \"\$file\"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# List of dependency packaged to be istalled via apt
|
# List of dependency packaged to be istalled via apt
|
||||||
packages="git
|
packages="git
|
||||||
vim
|
vim
|
||||||
|
|
@ -90,9 +77,33 @@ install-deps(){
|
||||||
install(){
|
install(){
|
||||||
if [[ $runuser == root ]] ; then
|
if [[ $runuser == root ]] ; then
|
||||||
installdir="${globalinstalldir}"
|
installdir="${globalinstalldir}"
|
||||||
|
bashrc_append="
|
||||||
|
# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
|
export prbl_functions=\"${installdir}/functions\"
|
||||||
|
if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
||||||
|
for file in \$HOME/.bashrc.d/*.bashrc ; do
|
||||||
|
source \"\$file\"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
"
|
||||||
globalinstall
|
globalinstall
|
||||||
else
|
else
|
||||||
installdir="${userinstalldir}"
|
installdir="${userinstalldir}"
|
||||||
|
bashrc_append="
|
||||||
|
# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
|
export prbl_functions=\"${installdir}/functions\"
|
||||||
|
if [ -n \"\$BASH_VERSION\" ]; then
|
||||||
|
# include .bashrc if it exists
|
||||||
|
if [ -d \"\$HOME/.bashrc.d\" ]; then
|
||||||
|
for file in \$HOME/.bashrc.d/*.bashrc ; do
|
||||||
|
source \"\$file\"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
"
|
||||||
userinstall
|
userinstall
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -195,7 +206,7 @@ globalinstall(){
|
||||||
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
||||||
scp -r ${rundir}/lib/skel/.* /home/${selecteduser}
|
scp -r ${rundir}/lib/skel/.* /home/${selecteduser}
|
||||||
if [[ $(cat /home/${selecteduser}/.bashrc | grep -c prbl) == 0 ]] ; then
|
if [[ $(cat /home/${selecteduser}/.bashrc | grep -c prbl) == 0 ]] ; then
|
||||||
su ${selecteduser} -c "echo -e $bashrc_append >> /home/${selecteduser}/.bashrc" && boxborder "bashc.d installed..." || fail "Unable to append .bashrc"
|
echo -e $bashrc_append >> /home/${selecteduser}/.bashrc && boxborder "bashc.d installed..." || warn "Malformed append on ${lbl}/home/${selecteduser}/.bashrc${dfl}. Check this file for errors"
|
||||||
fi
|
fi
|
||||||
crontab -l -u $selecteduser | cat - ${rundir}/lib/quickinfo.cron | crontab -u $selecteduser -
|
crontab -l -u $selecteduser | cat - ${rundir}/lib/quickinfo.cron | crontab -u $selecteduser -
|
||||||
mkdir -p /home/${selecteduser}/.quickinfo
|
mkdir -p /home/${selecteduser}/.quickinfo
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue