diff --git a/scripts/Config/Fonts/MicrosoftFonts/install.sh b/scripts/Config/Fonts/MicrosoftFonts/install.sh index 1e5efaa7..8d1a6449 100755 --- a/scripts/Config/Fonts/MicrosoftFonts/install.sh +++ b/scripts/Config/Fonts/MicrosoftFonts/install.sh @@ -7,7 +7,7 @@ else apt install -y p7zip-full libgumbo-dev libfuse-dev libssl-dev libcurl4-openssl-dev uuid-dev; workingDirectory="$(pwd)"; tempDir="$(mktemp -d)"; - cd $tempDir; + cd "$tempDir"; git clone https://github.com/fangfufu/httpdirfs.git; pushd httpdirfs; @@ -23,10 +23,10 @@ else rm -f /usr/local/bin/httpdirfs; - cd $tempDir; + cd "$tempDir"; wget -O CascadiaCode.zip https://github.com/microsoft/cascadia-code/releases/download/v2111.01/CascadiaCode-2111.01.zip; unzip -d . CascadiaCode.zip; cp ttf/* /usr/share/fonts/TTF; - cd $workingDirectory; + cd "$workingDirectory"; fi diff --git a/scripts/Config/Fonts/NerdFont/install.sh b/scripts/Config/Fonts/NerdFont/install.sh index 1bdff74f..8ef19443 100755 --- a/scripts/Config/Fonts/NerdFont/install.sh +++ b/scripts/Config/Fonts/NerdFont/install.sh @@ -4,11 +4,11 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE" "$USER"; else - homeDir=$(sudo -u $1 bash -c 'realpath ~'); + homeDir="$(sudo -u "$1" bash -c 'realpath ~')"; fontFileBaseName="Caskaydia Cove Regular Nerd Font Complete.otf"; - tempFile=$(sudo -u $1 mktemp -d)/$fontFileBaseName; + tempFile="$(sudo -u "$1" mktemp -d)/$fontFileBaseName"; destination=/usr/share/font/opentype; - sudo -u $1 cp "$homeDir/Nextcloud/Caskaydia Cove Regular Nerd Font Complete.otf" "$tempFile"; + sudo -u "$1" cp "$homeDir/Nextcloud/Caskaydia Cove Regular Nerd Font Complete.otf" "$tempFile"; cp "$tempFile" /usr/share/fonts/opentype; fi diff --git a/scripts/Config/GnomeExtensions/install.sh b/scripts/Config/GnomeExtensions/install.sh index 0b28e6b9..83a0ea51 100755 --- a/scripts/Config/GnomeExtensions/install.sh +++ b/scripts/Config/GnomeExtensions/install.sh @@ -1,8 +1,8 @@ #!/bin/bash commandName=gnome-shell-extension-installer; extensionLocation=/usr/share/gnome-shell/extensions; -workingDirectory=$(pwd); -contextRoot=$(mktemp -d); +workingDirectory="$(pwd)"; +contextRoot="$(mktemp -d)"; cd "$contextRoot"; sudo apt install -y jq; @@ -14,15 +14,15 @@ rm -rf "$contextRoot"; for id in 779 4907 1162 do - workingDirectory=$(pwd); - contextRoot=$(mktemp -d); - unzipLocation=$(mktemp -d); + workingDirectory="$(pwd)"; + contextRoot="$(mktemp -d)"; + unzipLocation="$(mktemp -d)"; cd "$contextRoot"; - gnome-shell-extension-installer $id --no-install; - sudo gnome-shell-extension-installer $id --yes; + gnome-shell-extension-installer "$id" --no-install; + sudo gnome-shell-extension-installer "$id" --yes; unzip ./*.zip -d "$unzipLocation"; - uuid=$(jq -r '.uuid' "$unzipLocation/metadata.json"); + uuid="$(jq -r '.uuid' "$unzipLocation/metadata.json")"; sudo chmod -R +r "$extensionLocation/$uuid"; gnome-extensions enable "$uuid"; diff --git a/scripts/Config/rclone/InstallSync.sh b/scripts/Config/rclone/InstallSync.sh index 7987cfad..47823f83 100755 --- a/scripts/Config/rclone/InstallSync.sh +++ b/scripts/Config/rclone/InstallSync.sh @@ -1,13 +1,13 @@ #!/bin/bash -provider=$1; -dirname=$2; -serviceName=rclone@$provider:$dirname; +provider="$1"; +dirname="$2"; +serviceName="rclone@$provider:$dirname"; echo "Please create a remote called \`$1\`"; rclone config; -mkdir -p ~/$dirname; +mkdir -p "~/$dirname"; -systemctl --user enable $serviceName; +systemctl --user enable "$serviceName"; systemctl --user daemon-reload; -systemctl --user start $serviceName; +systemctl --user start "$serviceName"; diff --git a/scripts/Devices/Surface/LinuxSurface/install.sh b/scripts/Devices/Surface/LinuxSurface/install.sh index c7807df4..c5da58ed 100755 --- a/scripts/Devices/Surface/LinuxSurface/install.sh +++ b/scripts/Devices/Surface/LinuxSurface/install.sh @@ -15,8 +15,8 @@ else systemctl enable iptsd; # Install DTX - package=$(mktemp); - wget https://github.com/linux-surface/surface-dtx-daemon/releases/download/v0.3.3-2/surface-dtx-daemon_0.3.3-2_amd64.deb -O $package; - dpkg -i $package; - rm -f $package; + package="$(mktemp)"; + wget https://github.com/linux-surface/surface-dtx-daemon/releases/download/v0.3.3-2/surface-dtx-daemon_0.3.3-2_amd64.deb -O "$package"; + dpkg -i "$package"; + rm -f "$package"; fi diff --git a/scripts/Devices/SurfaceBook2/SecureBoot/install.sh b/scripts/Devices/SurfaceBook2/SecureBoot/install.sh index 8d148c15..dd272eb2 100755 --- a/scripts/Devices/SurfaceBook2/SecureBoot/install.sh +++ b/scripts/Devices/SurfaceBook2/SecureBoot/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -scriptRoot=$(realpath "${BASH_SOURCE%/*}"); +scriptRoot="$(realpath "${BASH_SOURCE%/*}")"; # Elevate script if [ ! "$UID" -eq 0 ] @@ -25,18 +25,18 @@ else # Initialize variables src="./boot/efi/EFI/fedora"; esp=/boot/efi; - defaultBootDir=$esp/EFI/BOOT; - microsoftBootDir=$esp/EFI/Microsoft/Boot; + defaultBootDir="$esp/EFI/BOOT"; + microsoftBootDir="$esp/EFI/Microsoft/Boot"; systemdDirName=/EFI/systemd; - systemdFullName=$esp$systemdDirName; - systemdFile=$systemdFullName/systemd-bootx64.efi; - bootFile=$defaultBootDir/grubx64.efi; + systemdFullName="$esp$systemdDirName"; + systemdFile="$systemdFullName/systemd-bootx64.efi"; + bootFile="$defaultBootDir/grubx64.efi"; # Set up files - cp $systemdFile $bootFile; - cp "$src/shimx64.efi" $defaultBootDir/BOOTx64.efi; - cp "$src/mmx64.efi" $defaultBootDir; + cp "$systemdFile" "$bootFile"; + cp "$src/shimx64.efi" "$defaultBootDir/BOOTx64.efi"; + cp "$src/mmx64.efi" "$defaultBootDir"; cp /usr/lib/efitools/x86_64-linux-gnu/KeyTool.efi /boot/efi/EFI/systemd/; wget https://github.com/tianocore/edk2-archive/raw/master/ShellBinPkg/UefiShell/X64/Shell.efi -O "$systemdFullName/Shell.efi"; @@ -89,6 +89,6 @@ else mokutil --import "$keyDir/MOK.der"; # Remove context directory - cd $workingDirectory; - rm -rf $contextRoot; + cd "$workingDirectory"; + rm -rf "$contextRoot"; fi diff --git a/scripts/Devices/SurfaceBook2/SecureBoot/sign-modules.sh b/scripts/Devices/SurfaceBook2/SecureBoot/sign-modules.sh index f1a67a90..02b6c0a9 100755 --- a/scripts/Devices/SurfaceBook2/SecureBoot/sign-modules.sh +++ b/scripts/Devices/SurfaceBook2/SecureBoot/sign-modules.sh @@ -10,6 +10,6 @@ else for file in $(find /lib/modules /var/lib/dkms -name *.ko); do - kmodsign sha512 $keyFile $pubFile $file; + kmodsign sha512 "$keyFile" "$pubFile" "$file"; done fi diff --git a/scripts/Software/Brave/install-extensions.sh b/scripts/Software/Brave/install-extensions.sh index 496f13d7..69c335b0 100755 --- a/scripts/Software/Brave/install-extensions.sh +++ b/scripts/Software/Brave/install-extensions.sh @@ -5,46 +5,46 @@ then sudo bash "$BASH_SOURCE" "$USER"; else # Download and extract `youtube-music-dl` - archiveName=$(sudo -u $1 mktemp); - sudo -u $1 wget https://github.com/dougppaz/youtube-music-dl/releases/download/v1.2.1/youtube-music-dl.zip -O $archiveName; + archiveName="$(sudo -u "$1" mktemp)"; + sudo -u "$1" wget https://github.com/dougppaz/youtube-music-dl/releases/download/v1.2.1/youtube-music-dl.zip -O "$archiveName"; extensionName=youtube-music-dl; - contextRoot=$(sudo -u $1 mktemp -d); - extensionDir=$contextRoot/$extensionName; - keyFile=$extensionDir.pem; - extensionFile=$extensionDir.crx; - manifestFile=$extensionDir/manifest.json; + contextRoot="$(sudo -u "$1" mktemp -d)"; + extensionDir="$contextRoot/$extensionName"; + keyFile="$extensionDir.pem"; + extensionFile="$extensionDir.crx"; + manifestFile="$extensionDir/manifest.json"; extensionRoot=/usr/share/brave-extensions; - destination=$extensionRoot/$extensionName.crx; + destination="$extensionRoot/$extensionName.crx"; # Prepare extension - mkdir -p $extensionRoot; - sudo -u $1 unzip $archiveName -d $extensionDir; - sudo -u $1 brave-browser --pack-extension=$extensionDir; - rm $archiveName; + mkdir -p "$extensionRoot"; + sudo -u "$1" unzip "$archiveName" -d "$extensionDir"; + sudo -u "$1" brave-browser --pack-extension="$extensionDir"; + rm "$archiveName"; # Tamper manifest file - manifest="$(cat $manifestFile | jq ". + {key: "'"'"$(openssl rsa -in $keyFile -pubout -outform DER | openssl base64 -A)"'"'"}")"; - manifest="$(echo $manifest | jq ".background.persistent = false")"; - echo $manifest | sudo -u $1 tee $manifestFile; + manifest="$(cat "$manifestFile" | jq ". + {key: "'"'"$(openssl rsa -in "$keyFile" -pubout -outform DER | openssl base64 -A)"'"'"}")"; + manifest="$(echo "$manifest" | jq ".background.persistent = false")"; + echo "$manifest" | sudo -u "$1" tee "$manifestFile"; # Pack extension - extensionID=$(openssl rsa -in $keyFile -pubout -outform DER | shasum -a 256 | head -c32 | tr 0-9a-f a-p); - extensionVersion=$(cat $manifestFile | jq -r '.version'); - sudo -u $1 brave-browser --pack-extension=$extensionDir --pack-extension-key=$keyFile; + extensionID="$(openssl rsa -in "$keyFile" -pubout -outform DER | shasum -a 256 | head -c32 | tr 0-9a-f a-p)"; + extensionVersion="$(cat "$manifestFile" | jq -r '.version')"; + sudo -u "$1" brave-browser --pack-extension="$extensionDir" --pack-extension-key="$keyFile"; # Install extension and preinstall it - cp $extensionFile $extensionRoot; - configRoot=/opt/brave.com/brave/extensions/; - rm -rf $contextRoot; - chmod -R a+rx $extensionRoot; - chmod -R u+w $extensionRoot; - mkdir -p $configRoot; + cp "$extensionFile" "$extensionRoot"; + configRoot=/opt/brave.com/brave/extensions/ + rm -rf "$contextRoot"; + chmod -R a+rx "$extensionRoot"; + chmod -R u+w "$extensionRoot"; + mkdir -p "$configRoot"; { echo "{"; echo ' "external_crx": "'"$destination"'",'; echo ' "external_version": "'"$extensionVersion"'"'; echo "}"; - } | tee $configRoot/$extensionID.json; + } | tee "$configRoot/$extensionID.json"; fi diff --git a/scripts/Software/JetBrains/install-toolbox.sh b/scripts/Software/JetBrains/install-toolbox.sh index 945eafc7..d68983c7 100755 --- a/scripts/Software/JetBrains/install-toolbox.sh +++ b/scripts/Software/JetBrains/install-toolbox.sh @@ -4,15 +4,15 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE"; else - workingDirectory=$(pwd); - contextRoot=$(mktemp -d); - cd $contextRoot; + workingDirectory="$(pwd)"; + contextRoot="$(mktemp -d)"; + cd "$contextRoot"; curl -fsSL https://raw.githubusercontent.com/nagygergo/jetbrains-toolbox-install/1.1/jetbrains-toolbox.sh \ | bash; - cd $workingDirectory; - rm -rf $contextRoot; + cd "$workingDirectory"; + rm -rf "$contextRoot"; { echo "[Desktop Entry]"; diff --git a/scripts/Software/Oh My Posh/install.sh b/scripts/Software/Oh My Posh/install.sh index 237f0b18..c119f3e1 100755 --- a/scripts/Software/Oh My Posh/install.sh +++ b/scripts/Software/Oh My Posh/install.sh @@ -5,21 +5,21 @@ then sudo bash "$BASH_SOURCE" "$USER"; else bin=oh-my-posh; - workingDirectory=$(pwd); - contextRoot=$(mktemp -d); - cd $contextRoot; + workingDirectory="$(pwd)"; + contextRoot="$(mktemp -d)"; + cd "$contextRoot"; - wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O $bin; - install $bin /usr/local/bin; + wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O "$bin"; + install "$bin" /usr/local/bin; - cd $workingDirectory; - rm -rf $contextRoot; + cd "$workingDirectory"; + rm -rf "$contextRoot"; - homeDir=$(sudo -u $1 bash -c 'realpath ~'); + homeDir="$(sudo -u "$1" bash -c 'realpath ~')"; - sudo -u $1 mkdir -p $homeDir/.omp; - sudo -u $1 cp $homeDir/Nextcloud/.omp/manuel.omp.json $homeDir/.omp/manuel.omp.json; + sudo -u "$1" mkdir -p "$homeDir/.omp"; + sudo -u "$1" cp "$homeDir/Nextcloud/.omp/manuel.omp.json" "$homeDir/.omp/manuel.omp.json"; echo 'eval "$(oh-my-posh init bash --config ~/.omp/manuel.omp.json)"' \ - | sudo -u $1 tee -a $homeDir/.bashrc; + | sudo -u "$1" tee -a "$homeDir/.bashrc"; fi diff --git a/scripts/Software/Visual Studio Code/install.sh b/scripts/Software/Visual Studio Code/install.sh index a0203e1e..4b1dafd9 100755 --- a/scripts/Software/Visual Studio Code/install.sh +++ b/scripts/Software/Visual Studio Code/install.sh @@ -5,17 +5,17 @@ then sudo bash "$BASH_SOURCE"; else apt install -y wget gpg; - keyFile=$(mktemp); + keyFile="$(mktemp)"; wget -qO- https://packages.microsoft.com/keys/microsoft.asc \ - | gpg --dearmor > $keyFile; + | gpg --dearmor > "$keyFile"; - install -D -o root -g root -m 644 $keyFile /etc/apt/keyrings/packages.microsoft.gpg; + install -D -o root -g root -m 644 "$keyFile" /etc/apt/keyrings/packages.microsoft.gpg; echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" \ | tee /etc/apt/sources.list.d/vscode.list; - rm -f $keyFile; + rm -f "$keyFile"; apt update; apt install -y code; diff --git a/scripts/Software/Woodpecker CLI/install.sh b/scripts/Software/Woodpecker CLI/install.sh index 575fac70..e5404519 100755 --- a/scripts/Software/Woodpecker CLI/install.sh +++ b/scripts/Software/Woodpecker CLI/install.sh @@ -4,9 +4,9 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE"; else - workingDirectory=$(pwd); - contextRoot=$(mktemp -d); - cd $contextRoot; + workingDirectory="$(pwd)"; + contextRoot="$(mktemp -d)"; + cd "$contextRoot"; # Preview from docker container # container_id="$(docker create woodpeckerci/woodpecker-cli:next)" @@ -19,6 +19,6 @@ else tar -xvzf woodpecker-cli.tar.gz; install woodpecker-cli /usr/local/bin; - cd $workingDirectory; - rm -rf $contextRoot; + cd "$workingDirectory"; + rm -rf "$contextRoot"; fi diff --git a/scripts/Software/logo-ls/install.sh b/scripts/Software/logo-ls/install.sh index b8a4990b..615eac42 100755 --- a/scripts/Software/logo-ls/install.sh +++ b/scripts/Software/logo-ls/install.sh @@ -4,16 +4,16 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE" "$USER"; else - package=$(mktemp); - wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_amd64.deb -O $package; - dpkg -i $package; - rm -f $package; + package="$(mktemp)"; + wget https://github.com/Yash-Handa/logo-ls/releases/download/v1.3.7/logo-ls_amd64.deb -O "$package"; + dpkg -i "$package"; + rm -f "$package"; - homeDir=$(sudo -u $1 bash -c 'realpath ~'); + homeDir="$(sudo -u "$1" bash -c 'realpath ~')"; { echo "alias ls='logo-ls -D'"; echo "alias ll='ls -al'"; echo "alias l='ls'"; - } | sudo -u $1 tee -a $homeDir/.bashrc; + } | sudo -u "$1" tee -a "$homeDir/.bashrc"; fi diff --git a/scripts/Software/rclone/install.sh b/scripts/Software/rclone/install.sh index 24911d00..ad361b0b 100755 --- a/scripts/Software/rclone/install.sh +++ b/scripts/Software/rclone/install.sh @@ -4,10 +4,10 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE"; else - package=$(mktemp); - wget https://github.com/rclone/rclone/releases/download/v1.60.0/rclone-v1.60.0-linux-amd64.deb -O $package; - dpkg -i $package; - rm -f $package; + package="$(mktemp)"; + wget https://github.com/rclone/rclone/releases/download/v1.60.0/rclone-v1.60.0-linux-amd64.deb -O "$package"; + dpkg -i "$package"; + rm -f "$package"; - cp ${BASH_SOURCE%/*}/rclone@.service /etc/systemd/user; + cp "${BASH_SOURCE%/*}/rclone@.service" /etc/systemd/user; fi diff --git a/scripts/Software/tea/install.sh b/scripts/Software/tea/install.sh index 6646439d..bfd17b1d 100755 --- a/scripts/Software/tea/install.sh +++ b/scripts/Software/tea/install.sh @@ -4,13 +4,13 @@ if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE"; else - workingDirectory=$(pwd); - contextRoot=$(mktemp -d); - cd $contextRoot; + workingDirectory="$(pwd)"; + contextRoot="$(mktemp -d)"; + cd "$contextRoot"; wget https://dl.gitea.io/tea/0.9.0/tea-0.9.0-linux-amd64 -O tea; install tea /usr/local/bin; - cd $workingDirectory; - rm -rf $contextRoot; + cd "$workingDirectory"; + rm -rf "$contextRoot"; fi