added better handling for existing installs
This commit is contained in:
parent
f27f47f507
commit
6f030b8138
1 changed files with 12 additions and 2 deletions
14
install.sh
14
install.sh
|
|
@ -8,6 +8,7 @@ VERSION=2.0.0
|
||||||
scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
|
scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
|
||||||
rundir=${0%/*}
|
rundir=${0%/*}
|
||||||
source ${rundir}/functions
|
source ${rundir}/functions
|
||||||
|
installer_functionsrev=$functionsrev
|
||||||
scriptname=${0##*/}
|
scriptname=${0##*/}
|
||||||
runuser=$(whoami)
|
runuser=$(whoami)
|
||||||
users=($(ls /home/))
|
users=($(ls /home/))
|
||||||
|
|
@ -145,10 +146,19 @@ export prbl_functions=\"${installdir}/functions\""
|
||||||
userinstall(){
|
userinstall(){
|
||||||
|
|
||||||
# Create install directory under user's home directory
|
# Create install directory under user's home directory
|
||||||
mkdir -p ${userinstalldir}
|
mkdir -p ${installdir}
|
||||||
|
|
||||||
|
# Check if functions already exist, and check if functions are out of date
|
||||||
|
if [ -f ${installdir}/functions ] ; then
|
||||||
|
# if functions are out of date, remove before installing new version
|
||||||
|
if [[ $(vercomp $(cat ${rundir/functions} | grep functionsrev ) $installer_functionsrev) == 2 ]] ; then
|
||||||
|
rm ${installdir}/functions
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Copy functions first
|
# Copy functions first
|
||||||
cp ${rundir}/PRbL/functions ${userinstalldir}/functions
|
cp ${rundir}/functions ${installdir}/functions
|
||||||
|
|
||||||
# Copy bashrc scripts to home folder
|
# Copy bashrc scripts to home folder
|
||||||
#cp -r ${rundir}/lib/skel/* $HOME/
|
#cp -r ${rundir}/lib/skel/* $HOME/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue