Check if symlink already exists to avoid sudo asking for passwords

This commit is contained in:
gpkvt 2023-07-14 22:56:46 +02:00
parent b2b409b918
commit 937b0b01eb
1 changed files with 6 additions and 2 deletions

View File

@ -2,5 +2,9 @@
GIT_ROOT=$(git rev-parse --show-toplevel)
sudo rm /etc/neofetch.conf
sudo ln -s ${GIT_ROOT}/neofetch/neofetch.conf /etc/neofetch.conf
if [[ -L "/etc/neofetch.conf" ]]; then
echo "Symlink for neofetch already exists, skipping"
else
echo "Creating symlink for neofetch.conf"
sudo ln -s ${GIT_ROOT}/neofetch/neofetch.conf /etc/neofetch.conf
fi