mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 10:23:42 +01:00
25 lines
574 B
Plaintext
25 lines
574 B
Plaintext
|
#!/bin/sh
|
||
|
# distrobox_binary
|
||
|
# name: default_root
|
||
|
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
|
||
|
command="/bin/distrobox-enter --root -n default_root -- /bin/nmap "
|
||
|
|
||
|
for arg in "$@"; do
|
||
|
if echo "${arg}" | grep -Eq "'|\""; then
|
||
|
command="${command} \
|
||
|
$(echo "${arg}" | sed 's|\\|\\\\|g' |
|
||
|
sed 's| |\\ |g' |
|
||
|
sed 's|\$|\\\$|g' |
|
||
|
sed "s|'|\\\'|g" |
|
||
|
sed 's|"|\\\"|g')"
|
||
|
elif echo "${arg}" | grep -q "'"; then
|
||
|
command="${command} \"${arg}\""
|
||
|
else
|
||
|
command="${command} '${arg}'"
|
||
|
fi
|
||
|
done
|
||
|
eval ${command}
|
||
|
else
|
||
|
/bin/nmap "$@"
|
||
|
fi
|