2020-10-25 20:35:33 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl bundix git libiconv libpcap libxml2 libxslt pkg-config postgresql ruby.devEnv sqlite xmlstarlet nix-update
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
|
2021-10-25 11:18:49 +00:00
|
|
|
latest=$(curl https://github.com/rapid7/metasploit-framework/tags.atom | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v atom:title -n | head -n1)
|
2020-10-25 20:35:33 +00:00
|
|
|
echo "Updating metasploit to $latest"
|
|
|
|
|
|
|
|
sed -i "s#refs/tags/.*#refs/tags/$latest\"#" Gemfile
|
|
|
|
|
|
|
|
bundler install
|
|
|
|
bundix
|
|
|
|
sed -i '/[ ]*dependencies =/d' gemset.nix
|
|
|
|
|
2023-12-10 17:58:00 +00:00
|
|
|
# Hacks
|
|
|
|
sed -i 's/nokogiri = {/nokogiri = {\n dependencies = ["mini_portile2" "racc"];/g' gemset.nix
|
|
|
|
|
2020-10-25 20:35:33 +00:00
|
|
|
cd "../../../../"
|
|
|
|
nix-update metasploit --version "$latest"
|