nano-tetra-modules/nmap/scripts/dependencies.sh

40 lines
818 B
Bash
Raw Permalink Normal View History

2017-11-16 05:42:22 +00:00
#!/bin/sh
#2015 - Whistle Master
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
#export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
logger "== RUNNING NMAP INSTALL SCRIPT"
2017-11-16 05:42:22 +00:00
[[ -f /tmp/nmap.progress ]] && {
exit 0
}
touch /tmp/nmap.progress
if [ "$1" = "install" ]; then
if [ "$2" = "internal" ]; then
2018-08-27 00:32:32 +00:00
opkg update
opkg install nmap
2017-11-16 05:42:22 +00:00
elif [ "$2" = "sd" ]; then
opkg update
opkg install nmap --dest sd
fi
2018-01-27 22:32:38 +00:00
# if [ ! -f /usr/lib/libpcap.so ] && [ -f /usr/lib/libpcap.so.1.3 ]; then
# ln -s /usr/lib/libpcap.so /usr/lib/libpcap.so.1.3
# fi
2017-11-16 05:42:22 +00:00
touch /etc/config/nmap
echo "config nmap 'module'" > /etc/config/nmap
uci set nmap.module.installed=1
uci commit nmap.module.installed
elif [ "$1" = "remove" ]; then
2018-08-27 00:32:32 +00:00
opkg remove nmap
rm -rf /etc/config/nmap
2017-11-16 05:42:22 +00:00
fi
rm /tmp/nmap.progress