Add VM tweaks bash script

This commit is contained in:
Johan 2022-12-19 10:18:39 +01:00
parent b9510e9f55
commit d6ac418e81
6 changed files with 40 additions and 1 deletions

View File

@ -24,3 +24,9 @@ sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/mast
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-dc.sh)"
```
## Install VM Tweaks
```bash
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/vm-tweaks.sh)"
```

View File

@ -1,5 +1,9 @@
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-apache.sh)"
# Make sure script is ran as root
if [[ $EUID -ne 0 ]]; then
exec sudo /bin/bash "$0" "$@"
fi
REALUSER=$(logname)
mkdir /home/$REALUSER/www 2>>install.log &

View File

@ -1,5 +1,9 @@
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-bind.sh)"
# Make sure script is ran as root
if [[ $EUID -ne 0 ]]; then
exec sudo /bin/bash "$0" "$@"
fi
REALUSER=$(logname)
apt update 2>>install.log

View File

@ -1,6 +1,11 @@
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-bind.sh)"
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-mysql.sh)"
# Make sure script is ran as root
if [[ $EUID -ne 0 ]]; then
exec sudo /bin/bash "$0" "$@"
fi
REALUSER=$(logname)
echo Running apt update...
apt -qq update 2>>install.log
if ! [ -f /etc/init.d/mysql* ]; then

View File

@ -2,7 +2,12 @@
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Make sure script is ran as root
if [[ $EUID -ne 0 ]]; then
exec sudo /bin/bash "$0" "$@"
fi
REALUSER=$(logname)
IP=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
GATEWAY=$(/sbin/ip route | awk '/default/ { print $3 }')
OS_VERSION=$(grep -oP 'VERSION_ID="\K[\d.]+' /etc/os-release)

15
BashScripts/vm-tweaks.sh Normal file
View File

@ -0,0 +1,15 @@
# Install using: sudo su -c "bash <(wget -qO- /url/to/vm-tweaks.sh)"
# Make sure script is ran as root
if [[ $EUID -ne 0 ]]; then
exec sudo /bin/bash "$0" "$@"
fi
REALUSER=$(logname)
rmmod floppy > /dev/null 2>&1 && (
echo Adding floppy to modprobe blacklist
echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf
dpkg-reconfigure initramfs-tools
)
echo 'Installation complete'