mirror of
https://github.com/brmlab/BLIT.git
synced 2025-06-09 12:24:01 +02:00
initial BLIT commit
This commit is contained in:
parent
7c2356fe80
commit
5130a2ab11
24 changed files with 900 additions and 0 deletions
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