added selection menu for installing to users from root
This commit is contained in:
parent
99b31f1184
commit
c682f6a07f
1 changed files with 21 additions and 11 deletions
22
install.sh
22
install.sh
|
|
@ -10,6 +10,7 @@ rundir=${0%/*}
|
||||||
source ${rundir}/pyr0-bash-functions/functions
|
source ${rundir}/pyr0-bash-functions/functions
|
||||||
scriptname=${0##*/}
|
scriptname=${0##*/}
|
||||||
runuser=$(whoami)
|
runuser=$(whoami)
|
||||||
|
users=($(ls /home/))
|
||||||
userinstalldir="$HOME/.local/share/prbl"
|
userinstalldir="$HOME/.local/share/prbl"
|
||||||
globalinstalldir="/usr/share/prbl"
|
globalinstalldir="/usr/share/prbl"
|
||||||
|
|
||||||
|
|
@ -135,9 +136,9 @@ userinstall(){
|
||||||
globalinstall(){
|
globalinstall(){
|
||||||
mkdir -p ${globalinstalldir}
|
mkdir -p ${globalinstalldir}
|
||||||
cp ${rundir}/pyr0-bash-functions/functions ${globalinstalldir}/functions
|
cp ${rundir}/pyr0-bash-functions/functions ${globalinstalldir}/functions
|
||||||
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
|
||||||
scp -r ${rundir}/lib/skel/.* /etc/skel/
|
|
||||||
check-deps
|
check-deps
|
||||||
|
detectvim
|
||||||
|
|
||||||
if [[ "$bins_missing" != "false" ]] ; then
|
if [[ "$bins_missing" != "false" ]] ; 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:"
|
echo -e "Missing utilities:"
|
||||||
|
|
@ -158,15 +159,24 @@ globalinstall(){
|
||||||
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
1) warn "Dependent Utilities missing: $bins_missing" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
detectvim
|
|
||||||
|
boxborder "Which users should PRbL be installed for?"
|
||||||
|
multiselect result users
|
||||||
|
idx=0
|
||||||
|
for selecteduser in "${users[@]}"; do
|
||||||
|
if [[ "${result[idx]}" == "true" ]] ; then
|
||||||
|
#cp -r ${rundir}/lib/skel/* /etc/skel/
|
||||||
|
scp -r ${rundir}/lib/skel/.* /home/${selecteduser}
|
||||||
if [[ $viminstall != null ]] ; then
|
if [[ $viminstall != null ]] ; then
|
||||||
cp $rundir/lib/vimfiles/crystallite.vim /usr/share/vim/${viminstall}/colors/crystallite.vim
|
cp $rundir/lib/vimfiles/crystallite.vim /usr/share/vim/${viminstall}/colors/crystallite.vim
|
||||||
cp $rundir/lib/vimfiles/vimrc.local /etc/vim/vimrc.local
|
cp $rundir/lib/vimfiles/vimrc.local /etc/vim/vimrc.local
|
||||||
fi
|
fi
|
||||||
if [[ $(cat /etc/skel/.bashrc | grep -c prbl) = 0 ]] ; then
|
if [[ $(cat /home/${selecteduser}/.bashrc | grep -c prbl) = 0 ]] ; then
|
||||||
echo -e $bashrc_append >> /etc/skel/.bashrc && boxborder "bashc.d installed..." || fail "Unable to append .bashrc"
|
echo -e $bashrc_append >> /home/${selecteduser}/.bashrc && boxborder "bashc.d installed..." || fail "Unable to append .bashrc"
|
||||||
fi
|
fi
|
||||||
crontab -l -u $runuser | cat - ${rundir}/lib/quickinfo.cron | crontab -u $runuser -
|
crontab -l -u $selecteduser | cat - ${rundir}/lib/quickinfo.cron | crontab -u $selecteduser -
|
||||||
|
fi
|
||||||
|
done
|
||||||
sensors-detect --auto
|
sensors-detect --auto
|
||||||
mkdir -p $HOME/.quickinfo
|
mkdir -p $HOME/.quickinfo
|
||||||
bash $HOME/.bashrc.d/11-quickinfo.bashrc -c
|
bash $HOME/.bashrc.d/11-quickinfo.bashrc -c
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue