Skip to content

Instantly share code, notes, and snippets.

@goneri
Last active November 4, 2019 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goneri/25d4460162136545d0b8faea48940ef3 to your computer and use it in GitHub Desktop.
Save goneri/25d4460162136545d0b8faea48940ef3 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eux
systemctl stop multi-user.target
systemctl stop applmgmt
systemctl stop getty@tty1.service
systemctl stop getty@tty2.service
systemctl stop vami-lighttp
systemctl stop dnsmasq
systemctl stop vmafdd
systemctl stop vmcad
systemctl stop vmdird
systemctl stop vmdnsd
systemctl stop vmtoolsd
systemctl stop vmware-firewall
systemctl stop vmware-pod
systemctl stop xinetd
systemctl stop vmware-vpxd
systemctl stop vmware-stsd
systemctl stop vmware-sts-idmd
systemctl stop vmware-vmon
systemctl stop syslog
systemctl stop syslog.socket
pkill -f '/usr/bin/python /usr/lib/applmgmt/ddns/py/ddns.py' || true
for mount_point in $(mount|awk '/mapper/ { print $3 }'); do
echo $mount_point
if ! test -d ${mount_point}.new; then
cp -Rvpa ${mount_point} ${mount_point}.new
fi
umount ${mount_point}
rm -r ${mount_point}
mv -f ${mount_point}.new ${mount_point}
done
cp -v /etc/fstab /etc/fstab.save
echo '
/dev/vda3 / ext4 defaults 1 1
/dev/vda2 swap swap defaults 0 0
/dev/vda1 /boot ext4 defaults,nosuid,noacl,nodev,noexec 1 2
/dev/cdrom /mnt/cdrom iso9660 ro,noauto,nosuid,nodev 0 0' > /etc/fstab
echo '
[Match]
Name=eth0
[Network]
DHCP=yes
[DHCP]
UseDNS=yes
' > /etc/systemd/network/10-eth0.network
echo '
[Resolve]
LLMNR=false
' > /etc/systemd/resolved.conf
@goneri
Copy link
Author

goneri commented Nov 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment