Advertisement
Guest User

Update Schedules File

a guest
Jul 16th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. SCHEDS=http://www.geocities.jp/binewsjp/ic/userlist1.txt
  2. if [ -f userlist1.txt ] ; then
  3. echo -n Backing up scheds...
  4. mv userlist1.txt userlist1.txt.old
  5. echo done.
  6. echo -n Downloading new scheds...
  7. wget -q $SCHEDS
  8. echo done.
  9. if [ ! -f userlist1.txt ] ; then
  10. echo -n No update, reverting...
  11. mv userlist1.txt.old userlist1.txt
  12. echo done.
  13. else
  14. echo -n Removing crap...
  15. cat userlist1.txt | sed 's,*,,' > userlist2.txt
  16. mv userlist2.txt userlist1.txt
  17. echo done.
  18. echo -n Removing headers...
  19. tail -n +5 userlist1.txt > userlist2.txt
  20. mv userlist2.txt userlist1.txt
  21. echo done.
  22. fi
  23. else
  24. echo -n Downloading new scheds...
  25. wget -q $SCHEDS
  26. echo done.
  27. echo -n Removing crap...
  28. cat userlist1.txt | sed 's,*,,' > userlist2.txt
  29. mv userlist2.txt userlist1.txt
  30. echo done.
  31. echo -n Removing headers...
  32. tail -n +5 userlist1.txt > userlist2.txt
  33. mv userlist2.txt userlist1.txt
  34. echo done.
  35.  
  36. fi
  37. touch userlist1.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement