grabSnowflake.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Copyright © 2024 Jeffrey Cliff
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or (at
  7. # your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. #echo "\$1" $1 "\$2" $2
  17. #exit
  18. DOMAIN=`echo $1 | awk -F'@' '{print $3}'`
  19. check_domain_for_banned_from_spc.sh $DOMAIN
  20. if [[ $? -eq 1 ]]; then
  21. echo "spc banned this server"
  22. exit 1;
  23. fi
  24. DB=/home/themusicgod1/TDL/urls.db
  25. # GRAB SNOWFLAKE
  26. echo "snowflake detection:"
  27. OUT=`sqlite3 $DB -line "select other from news where url like \"%"$1"%\""| awk -F' ' '{print $3}'`;
  28. echo "other is:" $OUT
  29. if [[ -z $OUT ]]; then
  30. echo "blank other";
  31. ID=`sqlite3 /home/themusicgod1/TDL/urls.db -line "select id from news where url = \""$1"\"" | awk -F' ' '{print $3}'`;
  32. echo $ID;
  33. echo $2;
  34. OTHER1=`sqlite3 $DB -line "select url, rss, other, id from news where url = \""$1"\"" | grep url | awk -F' ' '{print $3}'` ;
  35. OTHER2=`getSPCURL.sh $OTHER1`
  36. echo "update news set other = \""$OTHER2"\" where id = "$ID";"
  37. fi