Fix elevation script

This commit is contained in:
Manuel Thalmann 2022-11-13 01:11:32 +01:00
parent 626ab14a8b
commit cf0213f8e9
15 changed files with 235 additions and 235 deletions

View file

@ -2,8 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0" "$USER"
fi
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

View file

@ -2,9 +2,8 @@
# 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
@ -20,3 +19,4 @@ 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

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
sudo bash "$BASH_SOURCE"
else
# Create context directory
workingDirectory=$(pwd)
contextRoot=$(mktemp -d)
@ -44,3 +43,4 @@ cp $systemdFile $microsoftBootDir/$loaderBaseName
# Remove context directory
cd $workingDirectory
rm -rf $contextRoot
fi

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
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
@ -16,3 +15,4 @@ 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

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0" "$USER"
fi
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
@ -48,3 +47,4 @@ mkdir -p $configRoot
echo ' "external_version": "'"$extensionVersion"'"'
echo "}"
} | tee $configRoot/$extensionID.json
fi

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
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
@ -16,3 +15,4 @@ 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

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
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
@ -13,3 +12,4 @@ echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=
# Install Brave
apt update
apt install -y brave-browser
fi

View file

@ -2,10 +2,9 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
apt-get install -y wget gpg
sudo bash "$BASH_SOURCE"
else
apt install -y wget gpg
keyFile=$(mktemp)
wget -qO- https://packages.microsoft.com/keys/microsoft.asc \
@ -17,3 +16,4 @@ echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft
| tee /etc/apt/sources.list.d/vscode.list
rm -f $keyFile
fi

6
scripts/PopOS/software/codium.sh Normal file → Executable file
View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
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
@ -14,3 +13,4 @@ echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https:/
apt update
apt install -y codium
fi

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
sudo bash "$BASH_SOURCE"
else
commandName=gnome-shell-extension-installer
workingDirectory=$(pwd)
contextRoot=$(mktemp -d)
@ -19,3 +18,4 @@ rm -rf $contextRoot
gnome-shell-extension-installer 779 --yes
gnome-shell-extension-installer 4907 --yes
killall -SIGQUIT gnome-shell
fi

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0" "$USER"
fi
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
@ -17,3 +16,4 @@ homeDir=$(sudo -u $1 bash -c 'realpath ~')
echo "alias ll='ls -al'"
echo "alias l='ls'"
} | sudo -u $1 tee $homeDir/.bashrc
fi

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0" "$USER"
fi
sudo bash "$BASH_SOURCE" "$USER"
else
bin=oh-my-posh
workingDirectory=$(pwd)
contextRoot=$(mktemp -d)
@ -20,3 +19,4 @@ 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

View file

@ -2,8 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
sudo bash "$BASH_SOURCE"
else
apt install -y python3 python-is-python3 python3-pip
pip install pipenv
fi

View file

@ -2,12 +2,12 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
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

View file

@ -2,9 +2,8 @@
# Elevate script
if [ ! "$UID" -eq 0 ]
then
exec sudo bash "$0"
fi
sudo bash "$BASH_SOURCE"
else
workingDirectory=$(pwd)
contextRoot=$(mktemp)
cd $contextRoot
@ -14,3 +13,4 @@ install tea /usr/local/bin
cd $workingDirectory
rm -rf $contextRoot
fi