2022-11-12 13:42:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Elevate script
|
|
|
|
if [ ! "$UID" -eq 0 ]
|
|
|
|
then
|
2023-01-23 14:55:10 +00:00
|
|
|
sudo bash "$BASH_SOURCE" "$USER";
|
2022-11-13 00:11:32 +00:00
|
|
|
else
|
2023-01-23 15:11:51 +00:00
|
|
|
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";
|
2022-11-12 13:42:41 +00:00
|
|
|
|
2023-01-23 15:11:51 +00:00
|
|
|
homeDir="$(sudo -u "$1" bash -c 'realpath ~')";
|
2022-11-12 13:42:41 +00:00
|
|
|
|
2022-11-13 00:11:32 +00:00
|
|
|
{
|
2023-01-23 14:55:10 +00:00
|
|
|
echo "alias ls='logo-ls -D'";
|
|
|
|
echo "alias ll='ls -al'";
|
|
|
|
echo "alias l='ls'";
|
2023-01-23 15:11:51 +00:00
|
|
|
} | sudo -u "$1" tee -a "$homeDir/.bashrc";
|
2022-11-13 00:11:32 +00:00
|
|
|
fi
|