summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/beef/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/5pkgs/beef/update.sh')
-rwxr-xr-xmakefu/5pkgs/beef/update.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/makefu/5pkgs/beef/update.sh b/makefu/5pkgs/beef/update.sh
new file mode 100755
index 000000000..cce635f6d
--- /dev/null
+++ b/makefu/5pkgs/beef/update.sh
@@ -0,0 +1,28 @@
+#!/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 wget
+
+set -eu -o pipefail
+cd "$(dirname "$(readlink -f "$0")")"
+
+
+# TODO find the correct tag
+echo Fetching latest Gemfile
+wget https://raw.githubusercontent.com/beefproject/beef/master/Gemfile -O Gemfile
+rm -f Gemfile.lock
+echo Running bundler install
+bundler install
+echo Running bundix
+bundix
+exit 0
+
+latest=$(curl https://github.com/rapid7/metasploit-framework/releases.atom | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v atom:title -n | head -n1)
+echo "Updating metasploit to $latest"
+
+sed -i "s#refs/tags/.*#refs/tags/$latest\"#" Gemfile
+
+bundler install
+bundix
+sed -i '/[ ]*dependencies =/d' gemset.nix
+
+cd "../../../../"
+nix-update beef --version "$latest"