mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-09-20 05:14:30 +08:00
Update ubuntuInit.sh
This commit is contained in:
parent
5af0545497
commit
98506666da
1 changed files with 0 additions and 7 deletions
|
@ -50,7 +50,6 @@ targetLinuxMirror=$(grep "targetLinuxMirror" $confFile | awk '{print $2}')
|
|||
targetLinuxSecurityMirror=$(grep "targetLinuxSecurityMirror" $confFile | awk '{print $2}')
|
||||
cloudInitUrl=$(grep "cloudInitUrl" $confFile | awk '{print $2}')
|
||||
setFail2banStatus=$(grep "setFail2banStatus" $confFile | awk '{print $2}')
|
||||
serialConsolePropertiesForGrub=$(grep "serialConsolePropertiesForGrub" $confFile | sed -e 's/serialConsolePropertiesForGrub //g')
|
||||
|
||||
# Reset configurations of repositories.
|
||||
true >/etc/apk/repositories
|
||||
|
@ -126,12 +125,6 @@ echo 'datasource_list: [ NoCloud, None ]' >/mnt/etc/cloud/cloud.cfg.d/90_dpkg.cf
|
|||
sed -ri 's/ro net.ifnames=0 biosdevname=0/ro net.ifnames=0 biosdevname=0 ipv6.disable=1/g' /mnt/boot/grub/grub.cfg
|
||||
}
|
||||
|
||||
# Replace serial console parameters.
|
||||
[[ -n "$serialConsolePropertiesForGrub" && $(echo "$serialConsolePropertiesForGrub" | grep "ttyAMA[0-9]") ]] && {
|
||||
sed -ri 's/console=tty1 console=ttyS0/'$serialConsolePropertiesForGrub'/g' /mnt/etc/default/grub.d/50-cloudimg-settings.cfg
|
||||
sed -ri 's/console=tty1 console=ttyS0/'$serialConsolePropertiesForGrub'/g' /mnt/boot/grub/grub.cfg
|
||||
}
|
||||
|
||||
# Permit root user login by password, change ssh port.
|
||||
sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /mnt/etc/ssh/sshd_config
|
||||
sed -ri 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/g' /mnt/etc/ssh/sshd_config
|
||||
|
|
Loading…
Add table
Reference in a new issue