melawy-linux-welcome/scripts/unlock_pacman_db.sh

23 lines
304 B
Bash
Executable File

#!/bin/bash
if [[ "$UID" != 0 ]]; then
echo "USER NOT ROOT"
sudo "$0"
exit
else
echo "USER IS ROOT"
fi
if [ -f '/var/lib/pacman/db.lck' ]; then
killall pacman
rm -v /var/lib/pacman/db.lck
else
echo "Lock not found"
fi
echo "Finish!"
echo "This window may close!"
sleep 5