improved dependency install workflows
This commit is contained in:
parent
06fe9ba5b3
commit
056b28092f
1 changed files with 8 additions and 11 deletions
19
install.sh
19
install.sh
|
|
@ -22,7 +22,7 @@ globalinstalldir="/usr/share/prbl"
|
||||||
packages="git
|
packages="git
|
||||||
vim
|
vim
|
||||||
lm-sensors
|
lm-sensors
|
||||||
net-tools
|
curl
|
||||||
"
|
"
|
||||||
|
|
||||||
# OS distribution auto-detection
|
# OS distribution auto-detection
|
||||||
|
|
@ -123,7 +123,8 @@ check-deps(){
|
||||||
}
|
}
|
||||||
|
|
||||||
install-deps(){
|
install-deps(){
|
||||||
sudo /bin/bash -c "apt install -y $(echo -e $packages)"
|
boxborder "Installing packages $packages"
|
||||||
|
spin "for $_package in $packages ; do sudo apt=get install -y $_package ; done"
|
||||||
depsinstalled=true
|
depsinstalled=true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,6 +133,7 @@ install(){
|
||||||
installdir="${globalinstalldir}"
|
installdir="${globalinstalldir}"
|
||||||
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
export prbl_functions=\"${installdir}/functions\""
|
export prbl_functions=\"${installdir}/functions\""
|
||||||
|
globalinstall
|
||||||
else
|
else
|
||||||
installdir="${userinstalldir}"
|
installdir="${userinstalldir}"
|
||||||
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
prbl_bashrc="# Pyr0ball's Reductive Bash Library (PRbL) Functions library v$VERSION and greeting page setup
|
||||||
|
|
@ -221,12 +223,8 @@ globalinstall(){
|
||||||
"$(boxline "${red_x} No")"
|
"$(boxline "${red_x} No")"
|
||||||
)
|
)
|
||||||
case `select_opt "${utilsmissing_menu[@]}"` in
|
case `select_opt "${utilsmissing_menu[@]}"` in
|
||||||
0) until [[ $depsinstalled == true ]] ; do
|
0) boxborder "${grn}Installing dependencies...${dfl}"
|
||||||
boxborder "${grn}Installing dependencies...${dfl}"
|
spin "install-deps"
|
||||||
spin
|
|
||||||
install-deps
|
|
||||||
done
|
|
||||||
endspin
|
|
||||||
;;
|
;;
|
||||||
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -242,12 +240,13 @@ globalinstall(){
|
||||||
# If the selected user is set to true
|
# If the selected user is set to true
|
||||||
if [[ "${result[idx]}" == "true" ]] ; then
|
if [[ "${result[idx]}" == "true" ]] ; then
|
||||||
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
||||||
scp -r ${rundir}/lib/skel/.* /home/${selecteduser}
|
cp -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
|
||||||
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"
|
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
|
||||||
chown -R ${selecteduser}:${selecteduser} /home/${selecteduser}
|
chown -R ${selecteduser}:${selecteduser} /home/${selecteduser}
|
||||||
if [[ "$bins_missing" == "false" ]] ; then
|
if [[ "$bins_missing" == "false" ]] ; then
|
||||||
|
boxborder "Checking ${selecteduser}'s bashrc..."
|
||||||
su ${selecteduser} -c /home/${selecteduser}.bashrc.d/11-quickinfo.bashrc
|
su ${selecteduser} -c /home/${selecteduser}.bashrc.d/11-quickinfo.bashrc
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -288,12 +287,10 @@ remove(){
|
||||||
|
|
||||||
|
|
||||||
update(){
|
update(){
|
||||||
pushd $rundir
|
|
||||||
remove
|
remove
|
||||||
git stash -m "$pretty_date stashing changes before update to latest"
|
git stash -m "$pretty_date stashing changes before update to latest"
|
||||||
git fetch && git pull
|
git fetch && git pull
|
||||||
install
|
install
|
||||||
popd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#------------------------------------------------------#
|
#------------------------------------------------------#
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue