1
0
mirror of https://github.com/tommytran732/Linux-Setup-Scripts synced 2024-09-19 13:44:43 -04:00

Shellcheck fixes

Signed-off-by: Tommy <contact@tommytran.io>
This commit is contained in:
Tommy 2023-12-04 16:17:55 -07:00
parent 5b73cf5caa
commit 63b63e8129
No known key found for this signature in database
GPG Key ID: D30DEC268D3FEB17
7 changed files with 41 additions and 37 deletions

View File

@ -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 #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(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){
sudo -u nobody "$@" 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 # 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.) #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 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 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/* sudo sed -i 's/^metalink=.*/&\&protocol=https/g' /etc/yum.repos.d/*
# Remove unneeded packages # Remove firefox packages
sudo dnf -y remove fedora-bookmarks fedora-chromium-config firefox mozilla-filesystem \ 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 Network + hardware tools packages
#Remove support for some languages and spelling 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
ibus-typing-booster *speech* *zhuyin* *pinyin* *kkc* *m17n* *hangul* *anthy* words \
#Remove codec + image + printers #Remove support for some languages and spelling
openh264 ImageMagick* sane* simple-scan \ sudo dnf -y remove ibus-typing-booster '*speech*' '*zhuyin*' '*pinyin*' '*kkc*' '*m17n*' '*hangul*' '*anthy*' words
#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 codec + image + printers
#Remove vm and virtual stuff sudo dnf -y remove openh264 ImageMagick* sane* simple-scan
podman* *libvirt* open-vm* qemu-guest-agent hyperv* spice-vdagent virtualbox-guest-additions vino xorg-x11-drv-vmware xorg-x11-drv-amdgpu \
#NetworkManager #Remove Active Directory + Sysadmin + reporting tools
NetworkManager-pptp-gnome NetworkManager-ssh-gnome NetworkManager-openconnect-gnome NetworkManager-openvpn-gnome NetworkManager-vpnc-gnome ppp* ModemManager\ sudo dnf -y remove 'sssd*' realmd adcli cyrus-sasl-plain cyrus-sasl-gssapi mlocate quota* dos2unix kpartx sos abrt samba-client gvfs-smb
#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 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-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-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 \ gnome-classic* gnome-user* gnome-text-editor chrome-gnome-shell eog
#Remove apps
rhythmbox yelp evince libreoffice* cheese file-roller* mediawriter \ #Remove apps
#other sudo dnf remove -y rhythmbox yelp evince libreoffice* cheese file-roller* mediawriter
lvm2 rng-tools thermald *perl* yajl
#Remove other packages
sudo dnf remove -y lvm2 rng-tools thermald '*perl*' yajl
# Disable openh264 repo # Disable openh264 repo
sudo dnf config-manager --set-disabled fedora-cisco-openh264 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 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 # Install Microsoft Edge if x86_64
MACHINE_TYPE=`uname -m` MACHINE_TYPE=$(uname -m)
if [ "${MACHINE_TYPE}" == 'x86_64' ]; then if [ "${MACHINE_TYPE}" == 'x86_64' ]; then
output "x86_64 machine, installing Microsoft edge." output "x86_64 machine, installing Microsoft edge."
curl -O https://packages.microsoft.com/keys/microsoft.asc 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 # Installing tuned first here because virt-what is 1 of its dependencies anyways
sudo dnf install tuned -y sudo dnf install tuned -y
virt_type=$(echo $(virt-what)) virt_type=$(virt-what)
if [ "$virt_type" = "" ]; then if [ "$virt_type" = "" ]; then
output "Virtualization: Bare Metal." output "Virtualization: Bare Metal."
elif [ "$virt_type" = "openvz lxc" ]; then elif [ "$virt_type" = "openvz lxc" ]; then

View File

@ -17,7 +17,7 @@
#Run this after GCP-Debian-11.sh #Run this after GCP-Debian-11.sh
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){

View File

@ -15,7 +15,7 @@
# the License. # the License.
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){

View File

@ -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. # You need to add either the non-subscription repo or the testing repo from the Proxmox WebUI after running this script.
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
# Setup NTS # Setup NTS

View File

@ -17,7 +17,7 @@
#Assuming that you are using ANSSI-BP-028 #Assuming that you are using ANSSI-BP-028
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){
@ -159,7 +159,7 @@ sudo systemctl enable --now fstrim.timer
# Installing tuned first here because virt-what is 1 of its dependencies anyways # Installing tuned first here because virt-what is 1 of its dependencies anyways
sudo dnf install tuned -y sudo dnf install tuned -y
virt_type=$(echo $(virt-what)) virt_type=$(virt-what)
if [ "$virt_type" = "" ]; then if [ "$virt_type" = "" ]; then
output "Virtualization: Bare Metal." output "Virtualization: Bare Metal."
elif [ "$virt_type" = "openvz lxc" ]; then elif [ "$virt_type" = "openvz lxc" ]; then

View File

@ -18,7 +18,7 @@
##The script assumes you already have Ubuntu Pro activated ##The script assumes you already have Ubuntu Pro activated
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){

View File

@ -18,7 +18,7 @@
#The script assumes you already have Ubuntu Pro activated #The script assumes you already have Ubuntu Pro activated
output(){ output(){
echo -e '\e[36m'$1'\e[0m'; echo -e '\e[36m'"$1"'\e[0m';
} }
unpriv(){ unpriv(){
@ -170,7 +170,7 @@ sudo systemctl enable --now fstrim.timer
# Installing tuned first here because virt-what is 1 of its dependencies anyways # Installing tuned first here because virt-what is 1 of its dependencies anyways
sudo apt install tuned -y sudo apt install tuned -y
virt_type=$(echo $(virt-what)) virt_type=$(virt-what)
if [ "$virt_type" = "" ]; then if [ "$virt_type" = "" ]; then
output "Virtualization: Bare Metal." output "Virtualization: Bare Metal."
elif [ "$virt_type" = "openvz lxc" ]; then elif [ "$virt_type" = "openvz lxc" ]; then