bumped number of hosts to 50, some cleanup of folders/helper scripts
This commit is contained in:
15
helpers/online-users.sh
Executable file
15
helpers/online-users.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# cat /var/lib/misc/dnsmasq.leases | while read line; do loctet=$(echo $line | cut -f 4 -d . | cut -f 1 -d " "); printf "${line}\t"; sed -n "$loctet{p;q}" < <(tr ":" "," < /etc/workshopnames.yml | cut -f 1,3 -d, | tr , "\t") ; done | cut -b 30- | sort -b -k 2,2V | column -t
|
||||||
|
cat /var/lib/misc/dnsmasq.leases | cut -d' ' -f3-4 |
|
||||||
|
while read -r line; do
|
||||||
|
loctet=$(echo "$line" | cut -d'.' -f4 | cut -d' ' -f1)
|
||||||
|
printf '%s\t' "$line"
|
||||||
|
sed -n "${loctet}{p;q}" < <(
|
||||||
|
tr ':' ',' < /etc/workshopnames.yml |
|
||||||
|
cut -d',' -f1,3 |
|
||||||
|
tr ',' '\t'
|
||||||
|
)
|
||||||
|
done |
|
||||||
|
# cut -b30- |
|
||||||
|
sort -b -k2,2V |
|
||||||
|
column -t
|
||||||
@@ -20,26 +20,13 @@ echo "nameserver 192.168.0.1" > /etc/resolv.conf
|
|||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
(
|
(
|
||||||
# wait 60 seconds first
|
# wait 90 seconds first
|
||||||
sleep 60
|
sleep 90
|
||||||
# cat /var/lib/misc/dnsmasq.leases | while read line; do loctet=$(echo $line | cut -f 4 -d . | cut -f 1 -d " "); printf "${line}\t"; sed -n "$loctet{p;q}" < <(tr ":" "," < /etc/workshopnames.yml | cut -f 1,3 -d, | tr , "\t") ; done | cut -b 30- | sort -b -k 2,2V | column -t
|
/usr/local/bin/online-users.sh
|
||||||
cat /var/lib/misc/dnsmasq.leases | cut -d' ' -f3-4 |
|
|
||||||
while read -r line; do
|
|
||||||
loctet=$(echo "$line" | cut -d'.' -f4 | cut -d' ' -f1)
|
|
||||||
printf '%s\t' "$line"
|
|
||||||
sed -n "${loctet}{p;q}" < <(
|
|
||||||
tr ':' ',' < /etc/workshopnames.yml |
|
|
||||||
cut -d',' -f1,3 |
|
|
||||||
tr ',' '\t'
|
|
||||||
)
|
|
||||||
done |
|
|
||||||
# cut -b30- |
|
|
||||||
sort -b -k2,2V |
|
|
||||||
column -t
|
|
||||||
) > /online-users.txt & # ← background the whole subshell
|
) > /online-users.txt & # ← background the whole subshell
|
||||||
|
|
||||||
|
(/usr/sbin/sshd -D) &
|
||||||
|
|
||||||
# launch dnsmasq (automatically backgrounds)
|
# launch dnsmasq (automatically backgrounds)
|
||||||
dnsmasq --no-daemon
|
dnsmasq --no-daemon
|
||||||
|
|
||||||
# /usr/sbin/sshd -D
|
|
||||||
|
|||||||
Reference in New Issue
Block a user