From 63b63e81292f2885b15f4a5d1cc8c8248f650934 Mon Sep 17 00:00:00 2001 From: Tommy Date: Mon, 4 Dec 2023 16:17:55 -0700 Subject: [PATCH] Shellcheck fixes Signed-off-by: Tommy --- Fedora-Workstation-38.sh | 62 +++++++++++++++++++++------------------- GCP-Debian-11-Docker.sh | 2 +- GCP-Debian-11.sh | 2 +- Proxmox-8.sh | 2 +- RHEL-Server-9.sh | 4 +-- Ubuntu-22.04-Desktop.sh | 2 +- Ubuntu-22.04-Server.sh | 4 +-- 7 files changed, 41 insertions(+), 37 deletions(-) diff --git a/Fedora-Workstation-38.sh b/Fedora-Workstation-38.sh index dc42b78..4779074 100644 --- a/Fedora-Workstation-38.sh +++ b/Fedora-Workstation-38.sh @@ -17,18 +17,13 @@ #Please note that this is how I PERSONALLY setup my computer - I do some stuff such as not using anything to download GNOME extensions from extensions.gnome.org and installing the extensions as a package instead output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ sudo -u nobody "$@" } -#Variables -USER=$(whoami) -PARTITIONID=$(sudo cat /etc/crypttab | awk '{print $1}') -PARTITIONUUID=$(sudo blkid -s UUID -o value /dev/mapper/"${PARTITIONID}") - # Moving to the home directory #Note that I always use /home/${USER} because gnome-terminal is wacky and sometimes doesn't load the environment variables in correctly (Right click somewhere in nautilus, click on open in terminal, then hit create new tab and you will see.) cd /home/"${USER}" || exit @@ -96,29 +91,38 @@ echo -e '[zram0]\nzram-fraction = 1\nmax-zram-size = 8192\ncompression-algorithm unpriv curl https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/dnf/dnf.conf | sudo tee /etc/dnf/dnf.conf sudo sed -i 's/^metalink=.*/&\&protocol=https/g' /etc/yum.repos.d/* -# Remove unneeded packages -sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem \ - #Network + hardware tools - *cups nmap-ncat nfs-utils nmap-ncat openssh-server net-snmp-libs net-tools opensc traceroute rsync tcpdump teamd geolite2* mtr dmidecode sgpio \ - #Remove support for some languages and spelling - ibus-typing-booster *speech* *zhuyin* *pinyin* *kkc* *m17n* *hangul* *anthy* words \ - #Remove codec + image + printers - openh264 ImageMagick* sane* simple-scan \ - #Remove Active Directory + Sysadmin + reporting tools - sssd* realmd adcli cyrus-sasl-plain cyrus-sasl-gssapi mlocate quota* dos2unix kpartx sos abrt samba-client gvfs-smb \ - #Remove vm and virtual stuff - podman* *libvirt* open-vm* qemu-guest-agent hyperv* spice-vdagent virtualbox-guest-additions vino xorg-x11-drv-vmware xorg-x11-drv-amdgpu \ - #NetworkManager - NetworkManager-pptp-gnome NetworkManager-ssh-gnome NetworkManager-openconnect-gnome NetworkManager-openvpn-gnome NetworkManager-vpnc-gnome ppp* ModemManager\ - #Remove Gnome apps - gnome-photos gnome-connections gnome-tour gnome-themes-extra gnome-screenshot gnome-remote-desktop gnome-font-viewer gnome-calculator gnome-calendar gnome-contacts \ +# Remove firefox packages +sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem + +# Remove Network + hardware tools packages +sudo dnf -y remove '*cups' nmap-ncat nfs-utils nmap-ncat openssh-server net-snmp-libs net-tools opensc traceroute rsync tcpdump teamd geolite2* mtr dmidecode sgpio + +#Remove support for some languages and spelling +sudo dnf -y remove ibus-typing-booster '*speech*' '*zhuyin*' '*pinyin*' '*kkc*' '*m17n*' '*hangul*' '*anthy*' words + +#Remove codec + image + printers +sudo dnf -y remove openh264 ImageMagick* sane* simple-scan + +#Remove Active Directory + Sysadmin + reporting tools +sudo dnf -y remove 'sssd*' realmd adcli cyrus-sasl-plain cyrus-sasl-gssapi mlocate quota* dos2unix kpartx sos abrt samba-client gvfs-smb + +#Remove vm and virtual stuff +sudo dnf -y remove 'podman*' '*libvirt*' 'open-vm*' qemu-guest-agent 'hyperv*' spice-vdagent virtualbox-guest-additions vino xorg-x11-drv-vmware xorg-x11-drv-amdgpu + +#Remove NetworkManager +sudo dnf -y remove NetworkManager-pptp-gnome NetworkManager-ssh-gnome NetworkManager-openconnect-gnome NetworkManager-openvpn-gnome NetworkManager-vpnc-gnome ppp* ModemManager + +#Remove Gnome apps +sudo dnf remove -y gnome-photos gnome-connections gnome-tour gnome-themes-extra gnome-screenshot gnome-remote-desktop gnome-font-viewer gnome-calculator gnome-calendar gnome-contacts \ gnome-maps gnome-weather gnome-logs gnome-boxes gnome-disk-utility gnome-clocks gnome-color-manager gnome-characters baobab totem \ gnome-shell-extension-background-logo gnome-shell-extension-apps-menu gnome-shell-extension-launch-new-instance gnome-shell-extension-places-menu gnome-shell-extension-window-list \ - gnome-classic* gnome-user* gnome-text-editor chrome-gnome-shell eog \ - #Remove apps - rhythmbox yelp evince libreoffice* cheese file-roller* mediawriter \ - #other - lvm2 rng-tools thermald *perl* yajl + gnome-classic* gnome-user* gnome-text-editor chrome-gnome-shell eog + +#Remove apps +sudo dnf remove -y rhythmbox yelp evince libreoffice* cheese file-roller* mediawriter + +#Remove other packages + sudo dnf remove -y lvm2 rng-tools thermald '*perl*' yajl # Disable openh264 repo sudo dnf config-manager --set-disabled fedora-cisco-openh264 @@ -127,7 +131,7 @@ sudo dnf config-manager --set-disabled fedora-cisco-openh264 sudo dnf -y install gnome-console git-core gnome-shell-extension-appindicator gnome-shell-extension-blur-my-shell gnome-shell-extension-background-logo gnome-shell-extension-dash-to-dock gnome-shell-extension-no-overview # Install Microsoft Edge if x86_64 -MACHINE_TYPE=`uname -m` +MACHINE_TYPE=$(uname -m) if [ "${MACHINE_TYPE}" == 'x86_64' ]; then output "x86_64 machine, installing Microsoft edge." curl -O https://packages.microsoft.com/keys/microsoft.asc @@ -154,7 +158,7 @@ sudo systemctl restart fwupd # Installing tuned first here because virt-what is 1 of its dependencies anyways sudo dnf install tuned -y -virt_type=$(echo $(virt-what)) +virt_type=$(virt-what) if [ "$virt_type" = "" ]; then output "Virtualization: Bare Metal." elif [ "$virt_type" = "openvz lxc" ]; then diff --git a/GCP-Debian-11-Docker.sh b/GCP-Debian-11-Docker.sh index 6c2c4f1..64a5682 100644 --- a/GCP-Debian-11-Docker.sh +++ b/GCP-Debian-11-Docker.sh @@ -17,7 +17,7 @@ #Run this after GCP-Debian-11.sh output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ diff --git a/GCP-Debian-11.sh b/GCP-Debian-11.sh index 1a7167b..05cf921 100644 --- a/GCP-Debian-11.sh +++ b/GCP-Debian-11.sh @@ -15,7 +15,7 @@ # the License. output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ diff --git a/Proxmox-8.sh b/Proxmox-8.sh index 3984c05..c8f6c32 100644 --- a/Proxmox-8.sh +++ b/Proxmox-8.sh @@ -17,7 +17,7 @@ # You need to add either the non-subscription repo or the testing repo from the Proxmox WebUI after running this script. output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } # Setup NTS diff --git a/RHEL-Server-9.sh b/RHEL-Server-9.sh index fd20210..ee5522c 100644 --- a/RHEL-Server-9.sh +++ b/RHEL-Server-9.sh @@ -17,7 +17,7 @@ #Assuming that you are using ANSSI-BP-028 output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ @@ -159,7 +159,7 @@ sudo systemctl enable --now fstrim.timer # Installing tuned first here because virt-what is 1 of its dependencies anyways sudo dnf install tuned -y -virt_type=$(echo $(virt-what)) +virt_type=$(virt-what) if [ "$virt_type" = "" ]; then output "Virtualization: Bare Metal." elif [ "$virt_type" = "openvz lxc" ]; then diff --git a/Ubuntu-22.04-Desktop.sh b/Ubuntu-22.04-Desktop.sh index 40e8f85..45e7a7c 100644 --- a/Ubuntu-22.04-Desktop.sh +++ b/Ubuntu-22.04-Desktop.sh @@ -18,7 +18,7 @@ ##The script assumes you already have Ubuntu Pro activated output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ diff --git a/Ubuntu-22.04-Server.sh b/Ubuntu-22.04-Server.sh index 0128d54..bc8f137 100644 --- a/Ubuntu-22.04-Server.sh +++ b/Ubuntu-22.04-Server.sh @@ -18,7 +18,7 @@ #The script assumes you already have Ubuntu Pro activated output(){ - echo -e '\e[36m'$1'\e[0m'; + echo -e '\e[36m'"$1"'\e[0m'; } unpriv(){ @@ -170,7 +170,7 @@ sudo systemctl enable --now fstrim.timer # Installing tuned first here because virt-what is 1 of its dependencies anyways sudo apt install tuned -y -virt_type=$(echo $(virt-what)) +virt_type=$(virt-what) if [ "$virt_type" = "" ]; then output "Virtualization: Bare Metal." elif [ "$virt_type" = "openvz lxc" ]; then