mirror of
https://github.com/pentoo/pentoo-overlay
synced 2025-12-06 08:25:01 +01:00
eselect-metasploit: make it work for 17.1
This commit is contained in:
parent
d651e065a4
commit
e7b31323f2
2 changed files with 10 additions and 21 deletions
|
|
@ -29,7 +29,7 @@ src_install() {
|
|||
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd
|
||||
|
||||
insinto /usr/share/eselect/modules
|
||||
newins "${FILESDIR}/metasploit.eselect-0.13" metasploit.eselect
|
||||
newins "${FILESDIR}/metasploit.eselect-0.14" metasploit.eselect
|
||||
|
||||
newbin "${FILESDIR}"/msfloader-${PV} msfloader
|
||||
}
|
||||
|
|
@ -7,22 +7,11 @@ 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
|
||||
#base idea from kernel.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"
|
||||
MSFPATH="/usr/lib/metasploit"
|
||||
|
||||
# find a list of metasploit symlink targets and sort them
|
||||
find_targets() {
|
||||
|
|
@ -58,19 +47,19 @@ set_symlink() {
|
|||
|
||||
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)
|
||||
elif [[ -d ${EROOT}/usr/lib/${target} ]]; then
|
||||
ln -sf "${target}" "${EROOT}${MSFPATH}"
|
||||
for i in $(qlist metasploit | grep "/usr/lib/${target}/msf")
|
||||
do
|
||||
ln -s /usr/bin/msfloader /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
|
||||
ln -sf /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)
|
||||
ln -sf "metasploit${target}" "${EROOT}${MSFPATH}"
|
||||
for i in $(qlist metasploit | grep "/usr/libdir/${target}/msf")
|
||||
do
|
||||
ln -s /usr/bin/msfloader /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
|
||||
ln -sf /usr/bin/msfloader /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
|
||||
done
|
||||
else
|
||||
die -q "Target \"$1\" doesn't appear to be valid!"
|
||||
Loading…
Reference in a new issue