added pin file check

This commit is contained in:
Shihaam Abdul Rahman 2023-08-20 12:15:35 +05:00
parent 7eeecd9991
commit 709079c3e5
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -24,6 +24,10 @@ lock_tg(){
}
readpin(){
if [[ ! -f ~/.local/.tgpin.txt ]]; then
echo "Error: PIN file not found!"
exit 1
fi
tgpin=$(cat ~/.local/.tgpin.txt)
}
@ -37,9 +41,9 @@ if [ "$1" == "lock" ]; then
lock_tg
return_mouse
elif [ "$1" == "unlock" ]; then
readpin
get_tg_window_id
get_mouse_location
readpin
unlock_tg
return_mouse
else