mirror of
https://github.com/brmlab/BLIT.git
synced 2025-06-08 03:44:00 +02:00
initial BLIT commit
This commit is contained in:
parent
7c2356fe80
commit
5130a2ab11
24 changed files with 900 additions and 0 deletions
9
MaDHCPhost_changer/README.md
Normal file
9
MaDHCPhost_changer/README.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
=== Instalation ===
|
||||
# install dictionary
|
||||
apt-get install wamerican
|
||||
|
||||
cp hostnamechanger /etc/network/if-pre-up.d/
|
||||
chmod 755 /etc/network/if-pre-up.d/hostnamechanger
|
||||
|
||||
watch 'egrep "^send host-name" /etc/dhcp/dhclient.conf'
|
||||
# disconnect and connect back to your network
|
18
MaDHCPhost_changer/hostnamechanger
Executable file
18
MaDHCPhost_changer/hostnamechanger
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
WORDFILE="/usr/share/dict/words"
|
||||
# if no wordfile than fukitol
|
||||
test -f "$WORDFILE" || exit 0
|
||||
#Number of lines in $WORDFILE is max value for random chooser
|
||||
wordfile_lines=$(awk 'NF!=0 {++c} END {print c}' "$WORDFILE")
|
||||
|
||||
## bash VARIANT
|
||||
rnum="$((${RANDOM}*${RANDOM}%${wordfile_lines}+1))"
|
||||
newhostname="$(sed -n "$rnum p" $WORDFILE |sed 's/[^a-zA-Z0-9]//g')"
|
||||
|
||||
## coreutils VARIANT
|
||||
#newhostname="$(shuf -n1 /usr/share/dict/words|sed 's/[^a-zA-Z0-9]//g')"
|
||||
|
||||
#sed "s=$(hostname)=REPLACEME=g" -i /etc/hosts && hostname "$newhostname" && sed "s=REPLACEME=$(hostname)=g" -i /etc/hosts
|
||||
|
||||
sed -i "s+send host-name = .*+send host-name = \"${newhostname}\";+" /etc/dhcp/dhclient.conf
|
Loading…
Add table
Add a link
Reference in a new issue