summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Farina <zerochaos@gentoo.org>2014-04-25 16:28:47 +0000
committerRichard Farina <zerochaos@gentoo.org>2014-04-25 16:28:47 +0000
commite45390104faa15cbf4d623372e98223728b22db5 (patch)
tree305d408529d600dcce0acff067b1ec8ee540e7b0
parentVersion bump (bug #504896). (diff)
downloadhistorical-e45390104faa15cbf4d623372e98223728b22db5.tar.gz
historical-e45390104faa15cbf4d623372e98223728b22db5.tar.bz2
historical-e45390104faa15cbf4d623372e98223728b22db5.zip
improvements to the new method of handling Gemfile.lock
Package-Manager: portage-2.2.8-r1/cvs/Linux x86_64 Manifest-Sign-Key: 0xDD11F94A
-rw-r--r--app-admin/eselect-metasploit/ChangeLog9
-rw-r--r--app-admin/eselect-metasploit/Manifest31
-rw-r--r--app-admin/eselect-metasploit/eselect-metasploit-0.13.ebuild41
-rw-r--r--app-admin/eselect-metasploit/files/metasploit.eselect-0.13207
-rw-r--r--app-admin/eselect-metasploit/files/msfloader-0.1332
5 files changed, 305 insertions, 15 deletions
diff --git a/app-admin/eselect-metasploit/ChangeLog b/app-admin/eselect-metasploit/ChangeLog
index 88b18ba544ab..1b485e3db076 100644
--- a/app-admin/eselect-metasploit/ChangeLog
+++ b/app-admin/eselect-metasploit/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-admin/eselect-metasploit
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-metasploit/ChangeLog,v 1.3 2014/04/25 05:24:38 zerochaos Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-metasploit/ChangeLog,v 1.4 2014/04/25 16:28:42 zerochaos Exp $
+
+*eselect-metasploit-0.13 (25 Apr 2014)
+
+ 25 Apr 2014; Rick Farina <zerochaos@gentoo.org>
+ +eselect-metasploit-0.13.ebuild, +files/metasploit.eselect-0.13,
+ +files/msfloader-0.13:
+ improvements to the new method of handling Gemfile.lock
25 Apr 2014; Rick Farina <zerochaos@gentoo.org> files/metasploit.eselect-0.12:
missed a debug line, removing
diff --git a/app-admin/eselect-metasploit/Manifest b/app-admin/eselect-metasploit/Manifest
index adae8a7c0df5..560a32e2edb5 100644
--- a/app-admin/eselect-metasploit/Manifest
+++ b/app-admin/eselect-metasploit/Manifest
@@ -4,27 +4,30 @@ Hash: SHA512
AUX 91metasploit 203 SHA256 0b91f07ac952798368c8565c3dafd959683df8f5c7dfc6b01cf6ff0ed208c00d SHA512 84c85a5f5885ebfd54eeeba10688eb19cc2f1799424b14fc24e579fdf812713fb70220bd097a3c42e1bd29bf7fa421b688facc8ca5ed07bcd1d7480c080f7da8 WHIRLPOOL e6404e978c5d5d74c182740ce0e14dc45c979affb4119dcc2dfba8f72fd9ea0e12ff50b37b009313794d426df2d04b1dc4f02e3ea913f01474c93880fbb1f0ef
AUX metasploit.eselect-0.11 4974 SHA256 90c700993f8db51f45b1bc8aa89442de9ddb023ca509ae970bac998152acb64c SHA512 7e748fbdfe2cdb3e55324d9455901c40d76e075a2732691dd6d02ef9fc4a9d22f04799b0f74d17632175b5024ced53a70d29fe90ce8f8a23c1e169491236916a WHIRLPOOL a0185942ec5c9854e5ccf55f8b8ce3759b15c430ec787a57b773cbc5c1b04ca6d6f3da4d40a6c23386534dc77ee641dabee97814f561fab9774eb09c80195fd5
AUX metasploit.eselect-0.12 5450 SHA256 defdc98eed03d9be1cdc839899ec0c99876fd538f9234aa2519cf6ed297c3cf9 SHA512 67bd3dd5c596be809bd84bcef0184d8979e8c08571353659c13686d7828256bc41291ce11f57a650745a80f9f94fc5f35273075d604f99e95ae23f16a2a211df WHIRLPOOL 7bd6ae786ba23f43a56745de7e9fc171d1533a43eeffba35552f73bb01619274d3890b01aee2c8be0775eb600b0a2aca4652dcfad536edc29528d52dbac37970
+AUX metasploit.eselect-0.13 5200 SHA256 acbe25f8388e815b2c088e5cc5174c52d73b879a49c88ee7e19cd2e88acaecc8 SHA512 7a56614db0104d84e5ea18d45de42b0d35f8789d91625cfffd169153dae4c25150868a4a02e38a221ac2e198740596f5f9a35ef492dbe39565bcae2a5f99842d WHIRLPOOL 8f342bd1738fff00d34584392e322082639786f233f4f089f8986c78de21f9a4d5aaff5679745f0e6b75ffca9827490fc893633faf7ccfc7cc8b559f860a97d3
AUX msfconsole-0.12 595 SHA256 d405b7879c248ca550273874414110cbe4984790ec47e6cc15a343c0bc42d6db SHA512 ee90544c18f14195da5ac1d5838ed686e8dcff21724291dfeb07acb2c853167984e04fba50cb12d5a8059bec86e05b5d24400870100357b498e1b38f443e5f48 WHIRLPOOL 515347c55912f073eb1dd8507c6d8372d8a539fb3a9cade09dc2f1b96bab8f60893bdb7ae2de0a4f1be05cfb1c9279a645d7c56fd0076f114a7d0e8b4a6a8d0c
+AUX msfloader-0.13 852 SHA256 b286016b6a7376fcc4e0891c975ed72026d4eeb34606a220a3844ec8adf91599 SHA512 286ce70f3bf520c0434c2033154745809ed6da20bc765f352be6c9ed98c90789b358d62472556d0294b41d372df20bed53bc7569a404dc183f23e5ddfbabd745 WHIRLPOOL 161fcf19d28cf0d18dd793e474bd56097eb798962331fa88dee49bb5aa9de571b0e1dc917f613e033e17ee15aee1e31537b9bba315335520ed39e0591ffb4c3a
AUX msfrpcd.confd 370 SHA256 8b437413fb2e1d26161ce4232cb7d44cfd41d0923d18a82ac984a89a89c887f2 SHA512 88a52427233bc82dc36d8f627edee84ba6675cddcc4539bb3a28cfe6fd7fba673875d62a150dfa5314756f11a6b1a95453966b31a2ae1f9820c6ef936d463f90 WHIRLPOOL 2b704c60d06fc03ed1d65eecffd38e402342a3b4c5bb6d6817e0ed7c745944dfa38358bca5dfe5ae24cc0e0f9375cefd6b046f3630ec3c9650569b86679e52d8
AUX msfrpcd.initd 595 SHA256 8ed133c85877a8509c85703b738e0286d56c57620b251f98eaffa33e31ad64dd SHA512 62f5c7ae84078e76cbdaa4dccb3fa67871491c53ce7faa07fb75c05c91b25d6812adac90ad6868759b79d9382548bff4383760d604789a12c6537cadb5977873 WHIRLPOOL 1b27b7600ae097e0d4e9717d709d87bab103bcaa76ff852e2179a0d33888bfab04751ac865a9e54f6bb2e292d670098a1005a44e61001bbd0d6b674da6a1e36d
EBUILD eselect-metasploit-0.11.ebuild 928 SHA256 fc50fac149ce050b5406cd3e18ff7c9be64ad2a4e48c2f438ab2d4286991bfa9 SHA512 08f8910ff872dc135b2ce7bff4350552540b26994485cb0a8558a4b17c304eb4e82a33fdb64c5d9cb9d15ffd2e2d5b2a3a43a30b596acf8b1dd3dfd4fd1fb9da WHIRLPOOL b7bf70d1cbe290e6013e9cfea51feb8c76d12c7c610f20a19da7e0c2790cb43e35f49ed187b5245fd39a6ae5b540abaf07e48ef66b85136c42853e53d5919508
EBUILD eselect-metasploit-0.12.ebuild 1221 SHA256 819ee7759050aa3dfa04ed2c534c082fff81cf31549c9c55a09dbc09f80397e3 SHA512 1b6c156e249e90ad96f491ce84db65ff49cdd68b7756c85e45433ef1e0a5af327281e3e76111978128ee1d1123112eb6f1d532318016549f572e4e2144ffdeef WHIRLPOOL 4665d5d0711508872b1ed9d4025dbe6fc0df92557add1ae2481398f0812868a52d8bbefe4f54138ae218c5468994cce4b8c7d3331e1e2f15d15b75d7f254108e
-MISC ChangeLog 987 SHA256 6dd0449147f4caf593637d359d5cc05421b41ab053f1dfe34482b3546c3f2038 SHA512 e8bb2fe8f376412a4cddb098b5755e9744849508ab3dfd36b11d19a3df902ae577f80f83a058c085d70b0fc9e4ae9ce6ea47a28a91d1b1db2acc80916d6f31b5 WHIRLPOOL 4eef4c738840a26c7e27c4b6c10fe2b01694bdc3cfc4d1ce77f72cd873a40bafc832ad9524b6c3b60b2a5f9a9493f4df956710b43f81ec6497eeae9cbe503728
+EBUILD eselect-metasploit-0.13.ebuild 1050 SHA256 00fb25eb6dd843e8ad797d9725ba0737dce5372d56d97f576504991acdc33bad SHA512 f5beaa23dab527b23389b3205a59f4df04c51006e2f0cf9c854af5d3a81c7e7fe1c2c04503c59b2f0e2a066b57fc7d344058153260208adc216e55a4bc9775d8 WHIRLPOOL 2a180a8197533c36bb033f80659e27e0c7931f149b0863a1fded02ab994eef8dc385ec0f29534bab7ce381979557a0316bda48dbcf554f08c9fe1e2b7f7de5f1
+MISC ChangeLog 1228 SHA256 2b44ef9bee7cf7ea83ace0926a5cfb37f64ab5ed573a62602382df2b8f2a7e39 SHA512 c36f494ee977c516a3afd30f189287ad07993ac3bbcee4f4ffc52f3e31cf9a74a6b2d9349c89fae609aca4fc541cf656388b39d6744dd7158a52c25becb26032 WHIRLPOOL 6689c02ceb7f0063430116a8ef677124a5c0b1b244681257d0233bd4db62ad49d2aa25a6dfae2f9db1f28dfdc5ae23cc7879a13bfc1ae824cbe1b38dbde0aa54
MISC metadata.xml 274 SHA256 fcdb6e69f3adb718ed543a83635badf4e360a57c550760997c4c5f8ea5c7193a SHA512 8b3d3358fe15d41a5bae960eb75727923c05bab81f63ab6cbab1134e9f49fe69c7e710edf051765950c57a2ef0025207d5f7c129b2bdccfca5be3ec042cf458e WHIRLPOOL 152e28545dc06eb18012d2545644b8bd223c546d10524a7c879573fb1ad265d75ff1ae8e3a95ee6777dbff155ff4ab6795841a884d3dd722579fa8ed5fa6bb49
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
-iQIcBAEBCgAGBQJTWfIgAAoJEKXdFCfdEflKak8P/jP97FHTR1MrFv7STRCqPftx
-EdY4FYJm0ynDHAOQOb/gioH80q2A8fStVPC6L98gKEzTcK5NEhcp0q3UuztfJh3P
-jZEbEjrFQJMxjnjHsdDfgsMbxaFOho8AEJTjlFCFdit9/LsqVRQfSVivXmgum6yp
-pW1JPD49vApdj4AGOAr1tAy95Gjti+U096hyjelvfiPc4s5PRNAnAKYypXrQQfBh
-6xcqWvPnvLtseqND05rWgHEQ161xdhvgjR/jjA2pHNAQ8bHCh/Ww6bucB9BZyMF+
-qD1bVOv/cDOgSygDDdg2IrLTsZWKNDSUCzeFR0wFOllw6YAKNo6paKCgA0WgZ3n6
-2y9o5u+1ReNCkdiEedW8fnA9/GkXcmhffP/xHZe57+MQ7RsyvbkJtqtsubjUBbgg
-8/S02PiRmFKYDmJSHftFjbCiz7hJ6muwPkDw2owvvEKykm1sF2ZxfMaGh8hCr/Cl
-lEXB6sNzpjrhq7sPxNhnbwsBCLSE8zGJUXrFNJ9aW832N/QvcYFHHXV7tNvVmjvP
-OZbi74ezhn+v4OcjcuxrwXryIXziazlapuVCu6hZxXq3eQ/+YHHNnyr5MjXbVpat
-4MQDb4qwy1Yq4FnQILTIJ8FE6dlxCoT6ueUjVjNLBY9363P7zMltdo6cBpNXYCnE
-L5wjHzZChETwVTFVzawv
-=8qL6
+iQIcBAEBCgAGBQJTWo3HAAoJEKXdFCfdEflKLAkP/0WpQMefUjgETSsGgAxeaIEF
+QUrRANw4O+t0KGBrAuhp7oBCTLZ8Ko1c8jayOmV7MdMMmpG/UZsdaU7lJCSCqMVc
+bGh20rWWmhxLDzeJrHr0cfI8YS4MUnU53lItkFazx+UjnnCSs9jejYF5rB6mWylx
+OzCSZUP4LUWLphWSOfISxeIn+fhHYyLWEk6iimbsPxyYFyRefYKrUDzDXCZLzWp0
+gQ1toHyU9EZXUqR3FU1iyk/gw+SV7Gv8FiIyEnfj1of2oxPUM6pBtTCJUxC9z8Nm
+XKhUwls6LdbEVTWZvjjyIA/MMsB3YsC5sFB4bjBxGQ7Sdk+QUwtv25QaEr87X/oK
+CMK0GaFuRQ0Q1dAqaTpylqBrOP7Klhk59/9P5CyS/75bGYm5ZUPOY+uRFn/AvfyI
+HmzvLWsfUu3qIMC8j/8GGbtzWi1LyyFXwZukL1oTlidmcadw1KnUSU1Gy5grInj2
+dYWyYzeyoOoNZESf4xAkA3rDo+TN+TbAi9iT7sy98arq2D+ODGvS21jsY12rdZUo
+9pRqA+ahAiTIbE82SVl0EZmGCI0ucR5+kWiySbI9hhx0rx2UPc3vy1lmPHYmIsm0
+oUfRvGI4Jggqv1w3PSfuygfPVUvrwEGheDMGT3fSFEWPNm9IJ2zBgvn+JS489C53
+tMWwL0ZTEr96q0UhAFYc
+=YfW4
-----END PGP SIGNATURE-----
diff --git a/app-admin/eselect-metasploit/eselect-metasploit-0.13.ebuild b/app-admin/eselect-metasploit/eselect-metasploit-0.13.ebuild
new file mode 100644
index 000000000000..e11af87ab888
--- /dev/null
+++ b/app-admin/eselect-metasploit/eselect-metasploit-0.13.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-metasploit/eselect-metasploit-0.13.ebuild,v 1.1 2014/04/25 16:28:42 zerochaos Exp $
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="eselect module for metasploit"
+HOMEPAGE="http://www.pentoo.ch/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND="app-admin/eselect
+ !<net-analyzer/metasploit-4.6"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}
+
+src_install() {
+ #force to use the outdated bundled version of metasm
+ doenvd "${FILESDIR}"/91metasploit
+
+ newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd
+ newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd
+
+ insinto /usr/share/eselect/modules
+ newins "${FILESDIR}/metasploit.eselect-${PV}" metasploit.eselect
+
+ newbin "${FILESDIR}"/msfloader-${PV} msfloader
+}
+
+pkg_postinst() {
+ "${EROOT}"/usr/bin/eselect metasploit set --use-old 1
+ elog "To switch between installed slots, execute as root:"
+ elog " # eselect metasploit set [slot number]"
+}
diff --git a/app-admin/eselect-metasploit/files/metasploit.eselect-0.13 b/app-admin/eselect-metasploit/files/metasploit.eselect-0.13
new file mode 100644
index 000000000000..44d6f69de7a5
--- /dev/null
+++ b/app-admin/eselect-metasploit/files/metasploit.eselect-0.13
@@ -0,0 +1,207 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 2005-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2 or later
+# $
+
+DESCRIPTION="Control which metaploit version is active"
+MAINTAINER="zerochaos@pentoo.ch"
+
+###WARNING: don't even think of using this insanity for a reference (but it works,mostly)
+#base idea from kernel.eselect, get_libdir from php.eselect with --use-old from opencl.eselect
+#all modified randomly until it worked, entropy is wonderful
+###/WARNING
+
+inherit multilib
+
+get_libdir() {
+ local dir
+ if has lib64 $(list_libdirs); then
+ echo lib64
+ return
+ fi
+ echo lib
+}
+
+MSFPATH="/usr/$(get_libdir)/metasploit"
+
+# find a list of metasploit symlink targets and sort them
+find_targets() {
+ local f
+ for f in "${EROOT}${MSFPATH}"[[:digit:]]*; do
+ [[ -d ${f} ]] && basename "${f}"
+ done | LC_ALL=C sort
+}
+
+# remove the metasploit symlink
+remove_symlink() {
+ for i in $(qlist metasploit | grep $(canonicalise "${EROOT}${MSFPATH}")/msf)
+ do
+ if [ -L /usr/bin/$(echo ${i} | awk -F'/' '{print $5}') ]; then
+ unlink /usr/bin/$(echo ${i} | awk -F'/' '{print $5}') || die -q "failed to unlink ${i}"
+ fi
+ done
+ if [ -L ${EROOT}${MSFPATH} ]; then
+ unlink "${EROOT}${MSFPATH}" || die -q "failed to unlink ${EROOT}${MSFPATH}"
+ elif [ -e ${EROOT}${MSFPATH} ]; then
+ die -q "${EROOT}${MSFPATH} exists but is not a symlink"
+ fi
+}
+
+# set the metasploit symlink
+set_symlink() {
+ local target=$1
+
+ if is_number "${target}"; then
+ local targets=( $(find_targets) )
+ target=${targets[target-1]}
+ fi
+
+ if [[ -z ${target} ]]; then
+ die -q "Target \"$1\" doesn't appear to be valid!"
+ elif [[ -d ${EROOT}/usr/$(get_libdir)/${target} ]]; then
+ ln -s "${target}" "${EROOT}${MSFPATH}"
+ for i in $(qlist metasploit | grep /usr/$(get_libdir)/${target}/msf)
+ do
+ ln -s /usr/bin/msfloader /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
+ done
+ #this elif looks like it is trying to support setting by slot only,
+ #but that isn't supported by the rest of the script... fix or remove?
+ elif [[ -d ${EROOT}${MSFPATH}${target} ]]; then
+ ln -s "metasploit${target}" "${EROOT}${MSFPATH}"
+ for i in $(qlist metasploit | grep /usr/$(get_libdir)/${target}/msf)
+ do
+ ln -s /usr/bin/msfloader /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
+ done
+ else
+ die -q "Target \"$1\" doesn't appear to be valid!"
+ fi
+}
+
+# wrapper to safely set the symlink
+set_symlink_safe() {
+ if [[ -L ${EROOT}${MSFPATH} ]]; then
+ # existing symlink
+ remove_symlink || die -q "Couldn't remove existing symlink"
+ set_symlink "$1" || die -q "Couldn't set a new symlink"
+ #um, why is there an env-update here?
+ env-update
+ elif [[ -e ${EROOT}${MSFPATH} ]]; then
+ # we have something strange
+ die -q "${EROOT}${MSFPATH} exists but is not a symlink"
+ else
+ set_symlink "$1" || die -q "Couldn't set a new symlink"
+ fi
+}
+
+### show action ###
+
+describe_show() {
+ echo "Show the current metasploit symlink"
+}
+
+do_show() {
+ write_list_start "Current metasploit symlink:"
+ if [[ -L ${EROOT}${MSFPATH} ]]; then
+ local metasploit=$(canonicalise "${EROOT}${MSFPATH}")
+ write_kv_list_entry "${metasploit%/}" ""
+ else
+ write_kv_list_entry "(unset)" ""
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List available metasploit symlink targets"
+}
+
+do_list() {
+ local i targets=( $(find_targets) )
+
+ write_list_start "Available metasploit symlink targets:"
+ for (( i = 0; i < ${#targets[@]}; i++ )); do
+ [[ ${targets[i]} = \
+ $(basename "$(canonicalise "${EROOT}${MSFPATH}")") ]] \
+ && targets[i]=$(highlight_marker "${targets[i]}")
+ done
+ write_numbered_list -m "(none found)" "${targets[@]}"
+}
+
+### set action ###
+
+describe_set() {
+ echo "Set a new metasploit symlink target"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+describe_set_options() {
+ echo "<target> : Target name or number (from 'list' action)"
+ echo "--use-old : If an implementation is already set, use that one instead"
+}
+
+do_set() {
+ local action="error"
+ local current=$(basename "$(canonicalise "${EROOT}${MSFPATH}")")
+ local available=( $(find_targets) )
+ local new
+ local opt
+
+ while [[ ${#@} -gt 0 ]] ; do
+ opt=$1
+ shift
+ case ${opt} in
+ --use-old)
+ if [[ -n "${current}" ]] && has "${current}" "${available[@]}"; then
+ action="old-implementation"
+ fi
+ ;;
+ metasploit*)
+ if [[ "${action}" != "old-implementation" ]] ; then
+ action="set-implementation"
+ fi
+
+ if has ${opt} ${available[@]}; then
+ new="${opt}"
+ else
+ echo "You need to emerge ${opt} before you try to eselect it"
+ fi
+ ;;
+ *)
+ if [[ "${action}" != "old-implementation" ]] ; then
+ action="set-implementation"
+ fi
+
+ if is_number ${opt} ; then
+ #targets=( $(get_implementations) )
+ new=${available[opt - 1]}
+ if [[ -z ${new} ]] ; then
+ die -q "Unrecognized option: ${opt}"
+ fi
+ else
+ die -q "Unrecognized option: ${opt}"
+ fi
+ ;;
+ esac
+ done
+
+ case ${action} in
+ old-implementation)
+ set_symlink_safe ${current}
+ return $?
+ ;;
+ set-implementation)
+ if [[ -n ${new} ]] ; then
+ set_symlink_safe ${new}
+ return $?
+ else
+ die -q "Please specify an implementation to set"
+ fi
+ ;;
+ *)
+ die -q "Invalid usage of set action."
+ ;;
+ esac
+}
diff --git a/app-admin/eselect-metasploit/files/msfloader-0.13 b/app-admin/eselect-metasploit/files/msfloader-0.13
new file mode 100644
index 000000000000..56a0c5545870
--- /dev/null
+++ b/app-admin/eselect-metasploit/files/msfloader-0.13
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+#todo:
+#add in optional auto starting/stopping of postgres
+#check if Gemfile was modified before copying it EVERY time.
+
+#normally msf makes this dir, however, this script runs first
+if [ ! -d ~/.msf4 ]; then
+ mkdir ~/.msf4
+fi
+
+#we cannot control if msf* exits normally so always start with cleanup
+if [ -f ~/.msf4/Gemfile ]; then
+ rm ~/.msf4/Gemfile
+fi
+
+#fetch the latest Gemfile from the selected version of msf
+cp /usr/lib/metasploit/Gemfile ~/.msf4
+
+#ensure Gemfile.lock is up to date
+BUNDLE_GEMFILE=~/.msf4/Gemfile bundle check > /dev/null 2>&1
+if [ "$?" != "0" ]; then
+ if [ -f ~/.msf4/Gemfile.lock ]; then
+ rm ~/.msf4/Gemfile.lock
+ else
+ echo "Something went wrong, please open a bug for metasploit on https://bugs.gentoo.org"
+ fi
+fi
+
+#ready to go
+BUNDLE_GEMFILE=~/.msf4/Gemfile exec /usr/lib/metasploit/$(basename $0) "$@"
+#profit