From 709079c3e563d595f37ee12109f21c5a408a70b2 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sun, 20 Aug 2023 12:15:35 +0500 Subject: [PATCH] added pin file check --- scripts/tginput.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/tginput.sh b/scripts/tginput.sh index 683b4d6..ae8d730 100755 --- a/scripts/tginput.sh +++ b/scripts/tginput.sh @@ -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