diff --git a/scripts/PopOS/fonts.sh b/scripts/PopOS/fonts.sh index 836ffa46..55230541 100644 --- a/scripts/PopOS/fonts.sh +++ b/scripts/PopOS/fonts.sh @@ -2,8 +2,8 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" "$USER" + sudo bash "$BASH_SOURCE" "$USER" +else + homeDir=$(sudo -u $1 bash -c 'realpath ~') + cp "$homeDir/Nextcloud/Caskaydia Cove Regular Nerd Font Complete.otf" /usr/share/font/opentype fi - -homeDir=$(sudo -u $1 bash -c 'realpath ~') -cp "$homeDir/Nextcloud/Caskaydia Cove Regular Nerd Font Complete.otf" /usr/share/font/opentype diff --git a/scripts/PopOS/linux-surface.sh b/scripts/PopOS/linux-surface.sh index dcd692aa..059af10b 100644 --- a/scripts/PopOS/linux-surface.sh +++ b/scripts/PopOS/linux-surface.sh @@ -2,21 +2,21 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" -fi + sudo bash "$BASH_SOURCE" +else + wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \ + | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg -wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \ - | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg + echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" \ + | sudo tee /etc/apt/sources.list.d/linux-surface.list -echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" \ - | sudo tee /etc/apt/sources.list.d/linux-surface.list - -apt update + apt update apt install -y linux-image-surface linux-headers-surface iptsd libwacom-surface -systemctl enable iptsd + 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 + # 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 +fi diff --git a/scripts/PopOS/secure-boot.sh b/scripts/PopOS/secure-boot.sh index 7d8e8e9f..28e4c682 100644 --- a/scripts/PopOS/secure-boot.sh +++ b/scripts/PopOS/secure-boot.sh @@ -2,45 +2,45 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + # Create context directory + workingDirectory=$(pwd) + contextRoot=$(mktemp -d) + cd $contextRoot + + # Initialize variables + esp=/boot/efi + defaultBootDir=$esp/EFI/BOOT + microsoftBootDir=$esp/EFI/Microsoft/Boot + + systemdDirName=/EFI/systemd + systemdFullName=$esp$systemdDirName + systemdFile=$systemdFullName/systemd-bootx64.efi + + loaderBaseName=loader.efi + systemdLoaderFile=$systemdFullName/$loaderBaseName + + # Install PreLoader + wget https://blog.hansenpartnership.com/wp-uploads/2013/HashTool.efi + wget https://blog.hansenpartnership.com/wp-uploads/2013/PreLoader.efi + + cp {HashTool,PreLoader}.efi $systemdFullName + cp $systemdFile $systemdLoaderFile + efibootmgr --unicode --disk /dev/nvme0n1 --part 0 --create --label "PreLoader" --loader $systemdDirName/PreLoader.efi + + # Add fallbacks + cp ./HashTool.efi $defaultBootDir + cp $systemdFile $defaultBootDir/$loaderBaseName + cp ./PreLoader.efi $defaultBootDir/BOOTx64.EFI + + # Add Microsoft fallbacks + mkdir -p $microsoftBootDir + cp ./PreLoader.efi $microsoftBootDir/bootmgfw.efi + cp ./HashTool.efi $microsoftBootDir + cp $systemdFile $microsoftBootDir/$loaderBaseName + + # Remove context directory + cd $workingDirectory + rm -rf $contextRoot fi - -# Create context directory -workingDirectory=$(pwd) -contextRoot=$(mktemp -d) -cd $contextRoot - -# Initialize variables -esp=/boot/efi -defaultBootDir=$esp/EFI/BOOT -microsoftBootDir=$esp/EFI/Microsoft/Boot - -systemdDirName=/EFI/systemd -systemdFullName=$esp$systemdDirName -systemdFile=$systemdFullName/systemd-bootx64.efi - -loaderBaseName=loader.efi -systemdLoaderFile=$systemdFullName/$loaderBaseName - -# Install PreLoader -wget https://blog.hansenpartnership.com/wp-uploads/2013/HashTool.efi -wget https://blog.hansenpartnership.com/wp-uploads/2013/PreLoader.efi - -cp {HashTool,PreLoader}.efi $systemdFullName -cp $systemdFile $systemdLoaderFile -efibootmgr --unicode --disk /dev/nvme0n1 --part 0 --create --label "PreLoader" --loader $systemdDirName/PreLoader.efi - -# Add fallbacks -cp ./HashTool.efi $defaultBootDir -cp $systemdFile $defaultBootDir/$loaderBaseName -cp ./PreLoader.efi $defaultBootDir/BOOTx64.EFI - -# Add Microsoft fallbacks -mkdir -p $microsoftBootDir -cp ./PreLoader.efi $microsoftBootDir/bootmgfw.efi -cp ./HashTool.efi $microsoftBootDir -cp $systemdFile $microsoftBootDir/$loaderBaseName - -# Remove context directory -cd $workingDirectory -rm -rf $contextRoot diff --git a/scripts/PopOS/software/brave-beta.sh b/scripts/PopOS/software/brave-beta.sh index 4105a4af..881fd495 100644 --- a/scripts/PopOS/software/brave-beta.sh +++ b/scripts/PopOS/software/brave-beta.sh @@ -2,17 +2,17 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + # Prepare + apt install -y wget unzip jq apt-transport-https curl + curl -fsSLo /usr/share/keyrings/brave-browser-beta-archive-keyring.gpg https://brave-browser-apt-beta.s3.brave.com/brave-browser-beta-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-beta-archive-keyring.gpg arch=amd64] https://brave-browser-apt-beta.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-beta.list + + # Install Brave Beta + apt update + apt install -y brave-browser-beta + + # Add pre-installed extensions + sudo ln -s /opt/brave.com/brave/extensions /opt/brave.com/brave-beta/extensions fi - -# Prepare -apt install -y wget unzip jq apt-transport-https curl -curl -fsSLo /usr/share/keyrings/brave-browser-beta-archive-keyring.gpg https://brave-browser-apt-beta.s3.brave.com/brave-browser-beta-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-beta-archive-keyring.gpg arch=amd64] https://brave-browser-apt-beta.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-beta.list - -# Install Brave Beta -apt update -apt install -y brave-browser-beta - -# Add pre-installed extensions -sudo ln -s /opt/brave.com/brave/extensions /opt/brave.com/brave-beta/extensions diff --git a/scripts/PopOS/software/brave-extensions.sh b/scripts/PopOS/software/brave-extensions.sh index a1db8f82..37e45795 100644 --- a/scripts/PopOS/software/brave-extensions.sh +++ b/scripts/PopOS/software/brave-extensions.sh @@ -2,49 +2,49 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" "$USER" + 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 + extensionName=youtube-music-dl + + 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 + + # Prepare extension + 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 + + # Pack extension + extensionID=$(openssl rsa -in $keyFile -pubout -outform DER | sha256sum | 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 + { + echo "{" + echo ' "external_crx": "'"$destination"'",' + echo ' "external_version": "'"$extensionVersion"'"' + echo "}" + } | tee $configRoot/$extensionID.json fi - -# 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 -extensionName=youtube-music-dl - -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 - -# Prepare extension -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 - -# Pack extension -extensionID=$(openssl rsa -in $keyFile -pubout -outform DER | sha256sum | 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 -{ - echo "{" - echo ' "external_crx": "'"$destination"'",' - echo ' "external_version": "'"$extensionVersion"'"' - echo "}" -} | tee $configRoot/$extensionID.json diff --git a/scripts/PopOS/software/brave-nightly.sh b/scripts/PopOS/software/brave-nightly.sh index de914cd5..de19b40b 100644 --- a/scripts/PopOS/software/brave-nightly.sh +++ b/scripts/PopOS/software/brave-nightly.sh @@ -2,17 +2,17 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + # Prepare + apt install -y wget unzip jq apt-transport-https curl + curl -fsSLo /usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg https://brave-browser-apt-nightly.s3.brave.com/brave-browser-nightly-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg arch=amd64] https://brave-browser-apt-nightly.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-nightly.list + + # Install Brave Nightly + apt update + apt install -y brave-browser-nightly + + # Add pre-installed extensions + sudo ln -s /opt/brave.com/brave/extensions /opt/brave.com/brave-nightly/extensions fi - -# Prepare -apt install -y wget unzip jq apt-transport-https curl -curl -fsSLo /usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg https://brave-browser-apt-nightly.s3.brave.com/brave-browser-nightly-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-nightly-archive-keyring.gpg arch=amd64] https://brave-browser-apt-nightly.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-nightly.list - -# Install Brave Nightly -apt update -apt install -y brave-browser-nightly - -# Add pre-installed extensions -sudo ln -s /opt/brave.com/brave/extensions /opt/brave.com/brave-nightly/extensions diff --git a/scripts/PopOS/software/brave.sh b/scripts/PopOS/software/brave.sh index 31e3203f..7e596372 100644 --- a/scripts/PopOS/software/brave.sh +++ b/scripts/PopOS/software/brave.sh @@ -2,14 +2,14 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + # Prepare + apt install -y wget unzip jq apt-transport-https curl + curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list + + # Install Brave + apt update + apt install -y brave-browser fi - -# Prepare -apt install -y wget unzip jq apt-transport-https curl -curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg -echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list - -# Install Brave -apt update -apt install -y brave-browser diff --git a/scripts/PopOS/software/code.sh b/scripts/PopOS/software/code.sh index ee6db483..cc1a7190 100644 --- a/scripts/PopOS/software/code.sh +++ b/scripts/PopOS/software/code.sh @@ -2,18 +2,18 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + apt install -y wget gpg + keyFile=$(mktemp) + + wget -qO- https://packages.microsoft.com/keys/microsoft.asc \ + | gpg --dearmor > $keyFile + + 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 fi - -apt-get install -y wget gpg -keyFile=$(mktemp) - -wget -qO- https://packages.microsoft.com/keys/microsoft.asc \ - | gpg --dearmor > $keyFile - -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 diff --git a/scripts/PopOS/software/codium.sh b/scripts/PopOS/software/codium.sh old mode 100644 new mode 100755 index 6ba6e371..2d7de0bd --- a/scripts/PopOS/software/codium.sh +++ b/scripts/PopOS/software/codium.sh @@ -2,15 +2,15 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \ + | gpg --dearmor \ + | dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg + + echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' \ + | tee /etc/apt/sources.list.d/vscodium.list + + apt update + apt install -y codium fi - -wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \ - | gpg --dearmor \ - | dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg - -echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' \ - | tee /etc/apt/sources.list.d/vscodium.list - -apt update -apt install -y codium diff --git a/scripts/PopOS/software/gnome-extensions.sh b/scripts/PopOS/software/gnome-extensions.sh index dc229e67..b19f4f55 100755 --- a/scripts/PopOS/software/gnome-extensions.sh +++ b/scripts/PopOS/software/gnome-extensions.sh @@ -2,20 +2,20 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + commandName=gnome-shell-extension-installer + workingDirectory=$(pwd) + contextRoot=$(mktemp -d) + cd $contextRoot + + wget -O $commandName "https://github.com/brunelli/gnome-shell-extension-installer/raw/master/gnome-shell-extension-installer" + install $commandName /usr/local/bin + + cd $workingDirectory + rm -rf $contextRoot + + gnome-shell-extension-installer 779 --yes + gnome-shell-extension-installer 4907 --yes + killall -SIGQUIT gnome-shell fi - -commandName=gnome-shell-extension-installer -workingDirectory=$(pwd) -contextRoot=$(mktemp -d) -cd $contextRoot - -wget -O $commandName "https://github.com/brunelli/gnome-shell-extension-installer/raw/master/gnome-shell-extension-installer" -install $commandName /usr/local/bin - -cd $workingDirectory -rm -rf $contextRoot - -gnome-shell-extension-installer 779 --yes -gnome-shell-extension-installer 4907 --yes -killall -SIGQUIT gnome-shell diff --git a/scripts/PopOS/software/logo-ls.sh b/scripts/PopOS/software/logo-ls.sh index 6a61fdbb..e937ae68 100644 --- a/scripts/PopOS/software/logo-ls.sh +++ b/scripts/PopOS/software/logo-ls.sh @@ -2,18 +2,18 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" "$USER" + 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 + + 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 $homeDir/.bashrc fi - -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 ~') - -{ - echo "alias ls='logo-ls -D'" - echo "alias ll='ls -al'" - echo "alias l='ls'" -} | sudo -u $1 tee $homeDir/.bashrc diff --git a/scripts/PopOS/software/oh-my-posh.sh b/scripts/PopOS/software/oh-my-posh.sh index c01279eb..1e93132f 100644 --- a/scripts/PopOS/software/oh-my-posh.sh +++ b/scripts/PopOS/software/oh-my-posh.sh @@ -2,21 +2,21 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" "$USER" + sudo bash "$BASH_SOURCE" "$USER" +else + bin=oh-my-posh + 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 + + cd $workingDirectory + rm -rf $contextRoot + + homeDir=$(sudo -u $1 bash -c 'realpath ~') + + echo 'eval "$(oh-my-posh init bash --config ~/Nextcloud/.omp/manuel.omp.json)' \ + | sudo -u $1 tee $homeDir/.bashrc fi - -bin=oh-my-posh -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 - -cd $workingDirectory -rm -rf $contextRoot - -homeDir=$(sudo -u $1 bash -c 'realpath ~') - -echo 'eval "$(oh-my-posh init bash --config ~/Nextcloud/.omp/manuel.omp.json)' \ - | sudo -u $1 tee $homeDir/.bashrc diff --git a/scripts/PopOS/software/python.sh b/scripts/PopOS/software/python.sh index c74f7a93..5a59fb13 100644 --- a/scripts/PopOS/software/python.sh +++ b/scripts/PopOS/software/python.sh @@ -2,8 +2,8 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + apt install -y python3 python-is-python3 python3-pip + pip install pipenv fi - -apt install -y python3 python-is-python3 python3-pip -pip install pipenv \ No newline at end of file diff --git a/scripts/PopOS/software/rclone/install.sh b/scripts/PopOS/software/rclone/install.sh index 7b1f3762..561ede6d 100644 --- a/scripts/PopOS/software/rclone/install.sh +++ b/scripts/PopOS/software/rclone/install.sh @@ -2,12 +2,12 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + 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 + + cp ./rclone@.service /etc/systemd/user fi - -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 ./rclone@.service /etc/systemd/user diff --git a/scripts/PopOS/software/tea.sh b/scripts/PopOS/software/tea.sh index cb7b0e11..8a54ba20 100644 --- a/scripts/PopOS/software/tea.sh +++ b/scripts/PopOS/software/tea.sh @@ -2,15 +2,15 @@ # Elevate script if [ ! "$UID" -eq 0 ] then - exec sudo bash "$0" + sudo bash "$BASH_SOURCE" +else + workingDirectory=$(pwd) + contextRoot=$(mktemp) + 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 fi - -workingDirectory=$(pwd) -contextRoot=$(mktemp) -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