19 lines
487 B
Bash
Executable file
19 lines
487 B
Bash
Executable file
#!/bin/bash
|
|
# Elevate script
|
|
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";
|
|
|
|
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";
|
|
fi
|