This commit is contained in:
USER
2023-06-12 16:38:37 +01:00
parent dccb3bd6c3
commit 649cac260f
2 changed files with 33 additions and 1 deletions

32
shared/send_ports2.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
set -u
########################################################
send_ports () {
. /etc/os-release
if [ ${ID} = "alpine" ]
then
NPORTS=$(netstat -tulnp| awk '{ print $4 }'| awk -F0: '{ print $2 }'| sort -u | tr '\n' ' ')
else
NPORTS=$(ss -tulnp| awk '{ print $5 }'| awk -F0: '{ print $2 }'| sort -u | tr '\n' ' ')
fi
nn=""$NPORTS""
${ZSHARED}/shared/tmsg `uname -n` ${nn}
echo "${SERVER_TYPE}: finished $0"
}
main() {
echo "--------------Starting $0 -------------------------"
if [ -d /static/shared ]
then
ZSHARED=/static
else
ZSHARED=/zTools/zShared
fi
. ${ZSHARED}/shared/myshared
send_ports
echo "--------------Finished $0 -------------------------"
}
main