diff --git a/BashScripts/README.md b/BashScripts/README.md index 6d9ebe5..8da364f 100644 --- a/BashScripts/README.md +++ b/BashScripts/README.md @@ -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)" +``` + diff --git a/BashScripts/install-apache.sh b/BashScripts/install-apache.sh index 80fc71e..39cd218 100644 --- a/BashScripts/install-apache.sh +++ b/BashScripts/install-apache.sh @@ -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 & diff --git a/BashScripts/install-bind.sh b/BashScripts/install-bind.sh index c1fee09..a865331 100644 --- a/BashScripts/install-bind.sh +++ b/BashScripts/install-bind.sh @@ -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 diff --git a/BashScripts/install-mysql.sh b/BashScripts/install-mysql.sh index 2641465..36d3120 100644 --- a/BashScripts/install-mysql.sh +++ b/BashScripts/install-mysql.sh @@ -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 diff --git a/BashScripts/install-ubuntu-dc.sh b/BashScripts/install-ubuntu-dc.sh index dd12778..f7d4b7d 100644 --- a/BashScripts/install-ubuntu-dc.sh +++ b/BashScripts/install-ubuntu-dc.sh @@ -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) diff --git a/BashScripts/vm-tweaks.sh b/BashScripts/vm-tweaks.sh new file mode 100644 index 0000000..b1a63c6 --- /dev/null +++ b/BashScripts/vm-tweaks.sh @@ -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' \ No newline at end of file