Update RHELinit.sh

This commit is contained in:
Molly Lau 2023-10-01 04:10:01 +09:00 committed by GitHub
parent db0e760508
commit f3df03cffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,7 @@ wget --no-check-certificate -qO $cloudInitFile ''$cloudInitUrl''
# User config. # User config.
sed -ri 's/HostName/'${HostName}'/g' $cloudInitFile sed -ri 's/HostName/'${HostName}'/g' $cloudInitFile
sed -ri 's/tmpWORD/'${tmpWORD}'/g' $cloudInitFile sed -ri 's/tmpWORD/'${tmpWORD}'/g' $cloudInitFile
sed -ri 's/sshPORT/'${sshPORT}'/g' $cloudInitFile
sed -ri 's/TimeZone/'${TimeZone1}'\/'${TimeZone2}'/g' $cloudInitFile sed -ri 's/TimeZone/'${TimeZone1}'\/'${TimeZone2}'/g' $cloudInitFile
sed -ri 's/networkAdapter/'${networkAdapter}'/g' $cloudInitFile sed -ri 's/networkAdapter/'${networkAdapter}'/g' $cloudInitFile
if [[ "$iAddrNum" -ge "2" ]]; then if [[ "$iAddrNum" -ge "2" ]]; then
@ -124,7 +125,7 @@ sed -ri 's/^#?Port.*/Port '${sshPORT}'/g' /mnt/etc/ssh/sshd_config
# Hack cloud init. # Hack cloud init.
utilProgram=$(find /mnt/usr/lib/python* -name "util.py" | grep "cloudinit" | head -n 1) utilProgram=$(find /mnt/usr/lib/python* -name "util.py" | grep "cloudinit" | head -n 1)
sed -ri 's/iso9660/osi9876/g' $utilProgram sed -ri 's/iso9660/osi9876/g' $utilProgram
sed -ri 's/blkid/diklb/g' $utilProgram sed -ri 's#"blkid"#"echo"#g' $utilProgram
# Umount mounted directory and loop device. # Umount mounted directory and loop device.
umount /mnt umount /mnt