From 74f86dfaa6b4d387b5ba1877c20d5a03a33f069c Mon Sep 17 00:00:00 2001 From: Dewalt <> Date: Fri, 25 Dec 2020 04:35:27 -0600 Subject: [PATCH] Update Fri Dec 25 04:35:27 AM CST 2020 --- README.md | 15 ++++++++++++--- pimpmykali.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d61d1fd..0a1dbc6 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,20 @@ - cd pimpmykali - sudo ./pimpmykali.sh - For a new kali vm, run menu option 0, then run D, then 9 - (youll need to run pimpmykali 3 times) -- if your having problems with theHarvester run menu option H + (youll need to run pimpmykali.sh 3 times) + - currently working on a function to script 0, D and 9 together! + +# Revision 1.0.7 - GO Lang - Enviornment Variables added to .zshrc and .bashrc + - function will check for GOPATH in .zshrc and .bashrc + - Checks added for root and regular users + - if "GOPATH" is not found in either .zshrc or .bashrc, variables will be added: + - export GOPATH=$HOME/go + - export PATH=$PATH:$GOPATH/bin + - if "GOPATH" is found, no changes will be made to either .zshrc or .bashrc + - Menu Options 0 (Fix All), 1 (Fix Missing) or 3 (Fix GoLang) will activate this function # Revision 1.0.6 - theHarvester fix removed - - Python3.9.1 has arrived! No longer in Release Candidate status! + - Python3.9.1 has arrived! No longer in Release Candidate status! - theHarvester fix is no longer necessary and has been commented as of this Revision - if no further complications, code will be removed completely diff --git a/pimpmykali.sh b/pimpmykali.sh index a36cc83..e4b55bf 100755 --- a/pimpmykali.sh +++ b/pimpmykali.sh @@ -9,7 +9,7 @@ # Standard Disclaimer: Author assumes no liability for any damage # revision var - revision="1.0.6" + revision="1.0.7" # unicorn puke: red=$'\e[1;31m' @@ -202,6 +202,51 @@ fix_golang () { section="golang" check=$(whereis go | grep -i -c "/usr/bin/go") fix_section $section $check $force + fix_go_path + } + +fix_go_path() { + findrealuser=$(who | awk '{print $1}') + if [ $findrealuser == "root" ] + then + check_zshrc=$(cat /root/.zshrc | grep -c GOPATH) + if [ $check_zshrc -ne 0 ] + then + echo -e "\n $redminus GOPATH Variables for $findrealuser already exist in /root/.zshrc - Not changing" + else + echo -e "\n $greenplus Adding GOPATH Variables to /root/.zshrc" + eval echo -e 'export GOPATH=\$HOME/go' >> /root/.zshrc + eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /root/.zshrc + fi + check_root_bashrc=$(cat /root/.bashrc | grep -c GOPATH) + if [ $check_root_bashrc -ne 0 ] + then + echo -e "\n $redminus GOPATH Variables for $findrealuser already exist in /root/.bashrc - Not changing" + else + echo -e "\n $greenplus Adding GOPATH Variables to /root/.bashrc" + eval echo -e 'export GOPATH=\$HOME/go' >> /root/.bashrc + eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /root/.bashrc + fi + else + check_user_zshrc=$(cat /home/$findrealuser/.zshrc | grep -c GOPATH) + if [ $check_user_zshrc -ne 0 ] + then + echo -e "\n $redminus GOPATH Variables for user $findrealuser already exist in /home/$findrealuser/.zshrc - Not Changing" + else + echo -e "\n $greenplus Adding GOPATH Variables to /home/$findrealuser/.zshrc" + eval echo -e 'export GOPATH=\$HOME/go' >> /home/$findrealuser/.zshrc + eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /home/$findrealuser/.zshrc + fi + check_user_bashrc=$(cat /home/$findrealuser/.bashrc | grep -c GOPATH) + if [ $check_user_bashrc -ne 0 ] + then + echo -e "\n $redminus GOPATH Variables for user $findrealuser already exist in /home/$findrealuser/.bashrc - Not Changing" + else + echo -e "\n $greenplus Adding GOPATH Variables to /home/$findrealuser/.bashrc" + eval echo -e 'export GOPATH=\$HOME/go' >> /home/$findrealuser/.bashrc + eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /home/$findrealuser/.bashrc + fi + fi } fix_smbconf () {