Giter VIP home page Giter VIP logo

Comments (6)

1N3 avatar 1N3 commented on September 15, 2024 3

Thanks for the assist! This is implemented in v1.5a.

from findsploit.

1N3 avatar 1N3 commented on September 15, 2024

I like the idea and will implement it but do you have details for how to query the Github API for the latest release version? If you want to send a pull request with the changes, that works too.

from findsploit.

alexanderepstein avatar alexanderepstein commented on September 15, 2024
Set this at the top of the file and change it with every new release
currentVersion=1.5
This is the code that would go under the Findsploit -u option which I can show you how to setup later. I modified this from my own code, it seems you use egrep where I use perl grep I'm not sure how that will affect the functionality. I can look into a further solid implementation later today or tomorrow and will create a pull request.
   if [[ $(curl -s https://api.github.com/repos/1N3/Findsploit/tags) == "" ]];then
    echo "Error: no active internet connection"
    exit 1
  fi
  latestVersion=$(curl -s https://api.github.com/repos/1N3/Findsploit/tags | grep -Po '"name":.*?[^\\]",'| head -1 | cut -c11-13)
  if [[ "$latestVersion" != "$currentVersion"  && "$latestVersion" != "" ]]; then
    echo "Version $latestVersion available"
    echo -n "Do you wish to update Findsploit [Y/n]: "
    read answer
  if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
  cd  ~ || { echo 'Update Failed' ; exit 1 ; }
rm -r Findsploit  2> /dev/null
git clone https://github.com/1N3/Findsploit || {echo "Couldn't download latest version" ; exit 1; }
cd Findsploit ||  { echo 'Update Failed' ; exit 1 ;}
git checkout $latestVersion 2> /dev/null
#chmod +x install.sh #this might be necessary in your case but wasnt in mine.
./install.sh
cd .. 
rm -r Findsploit
  else
      exit 1
  fi

else
  echo "Findsploit is already the latest version"
fi

If you are going to add options, a -v option is also nice it essentially just echos the current version variable which my method requires you to set at the top of the bash file anyways
echo "Findsploit Version $currentVersion"

from findsploit.

alexanderepstein avatar alexanderepstein commented on September 15, 2024

Seems like you implemented it well, just know that the cut command when checking the GitHub api for the latest version is not going to recognize that the latest version is 1.5a it will only recognize [a-Z || 0-9].[a-Z || 0-9] Therefore currently the program will set the latest_version variable for the 1.5a release as 1.5 so it will believe you are on the latest version

from findsploit.

1N3 avatar 1N3 commented on September 15, 2024

ah, good catch man! Thanks for the pull request.

from findsploit.

alexanderepstein avatar alexanderepstein commented on September 15, 2024

Glad to help

from findsploit.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.