1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-17 07:10:17 -07:00
patmenu2/sms/remove-carrier
2022-08-07 09:51:27 -05:00

39 lines
870 B
Bash
Executable File

#!/bin/bash
#script to remove phone carries to master list
#KM4ACK 02AUGUST2022
FILE=$HOME/patmenu2/sms/myphonelist.txt
MYTEMP=/run/user/$UID/templist.txt
MAIN=$HOME/patmenu2/sms/manage-sms
export MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png
INFO=$(PARSER='OFS="\n" {print $1}'
tail -300 $FILE | awk "$PARSER" | \
yad --title="Search Results" --width=600 --height=500 \
--image $LOGO --window-icon=$LOGO --image-on-top --multiple \
--center --list --text="Current Carrier List" \
--column Carrier \
--button="Cancel":1 \
--button="Remove Carrier":2 > $MYTEMP)
BUT=$?
if [ $BUT = 1 ]; then
$MAIN &
exit
elif [ $BUT = 252 ]; then
exit
fi
sed -i 's/|//g' $MYTEMP
while read -r line; do
sed -i "/$line/d" $FILE
done < $MYTEMP
yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="The carrier list has been updated"
$MAIN &
exit