mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
test backport fix for hostname
This commit is contained in:
@ -23,7 +23,7 @@ fuECHO () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fuRANDOMWORD () {
|
fuRANDOMWORD () {
|
||||||
local myWORDFILE=/usr/share/dict/names
|
local myWORDFILE="$1"
|
||||||
local myLINES=$(cat $myWORDFILE | wc -l)
|
local myLINES=$(cat $myWORDFILE | wc -l)
|
||||||
local myRANDOM=$((RANDOM % $myLINES))
|
local myRANDOM=$((RANDOM % $myLINES))
|
||||||
local myNUM=$((myRANDOM * myRANDOM % $myLINES + 1))
|
local myNUM=$((myRANDOM * myRANDOM % $myLINES + 1))
|
||||||
@ -295,11 +295,9 @@ adduser --system --no-create-home --uid 2000 --disabled-password --disabled-logi
|
|||||||
|
|
||||||
# Let's set the hostname
|
# Let's set the hostname
|
||||||
fuECHO "### Setting a new hostname."
|
fuECHO "### Setting a new hostname."
|
||||||
myHOST=$(curl -s -f www.nsanamegenerator.com | html2text | tr A-Z a-z | awk '{print $1}')
|
a=$(fuRANDOMWORD /usr/share/dict/a.txt)
|
||||||
if [ "$myHOST" = "" ]; then
|
n=$(fuRANDOMWORD /usr/share/dict/n.txt)
|
||||||
fuECHO "### Failed to fetch name from remote, using local cache."
|
myHOST=$a$n
|
||||||
myHOST=$(fuRANDOMWORD)
|
|
||||||
fi
|
|
||||||
hostnamectl set-hostname $myHOST
|
hostnamectl set-hostname $myHOST
|
||||||
sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts
|
sed -i 's#127.0.1.1.*#127.0.1.1\t'"$myHOST"'#g' /etc/hosts
|
||||||
|
|
||||||
|
1466
installer/usr/share/dict/a.txt
Normal file
1466
installer/usr/share/dict/a.txt
Normal file
File diff suppressed because it is too large
Load Diff
4401
installer/usr/share/dict/n.txt
Normal file
4401
installer/usr/share/dict/n.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -116,7 +116,7 @@ in-target grub-install --force $(debconf-get partman-auto/disk); \
|
|||||||
in-target update-grub; \
|
in-target update-grub; \
|
||||||
cp /opt/tpot/rc.local.install /target/etc/rc.local; \
|
cp /opt/tpot/rc.local.install /target/etc/rc.local; \
|
||||||
cp -r /opt/tpot/ /target/root/; \
|
cp -r /opt/tpot/ /target/root/; \
|
||||||
cp /opt/tpot/usr/share/dict/names /target/usr/share/dict/names
|
cp /opt/tpot/usr/share/dict/* /target/usr/share/dict/
|
||||||
|
|
||||||
##########
|
##########
|
||||||
### Reboot
|
### Reboot
|
||||||
|
Reference in New Issue
Block a user