Advertisement
Guest User

lalala

a guest
Dec 28th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. gamename="minetest_game";
  4. modsdir="$HOME/.minetest/games/$gamename/mods";
  5.  
  6. oIFS="$IFS";
  7. IFS='
  8. ';
  9.  
  10. for mod in `ls "$modsdir/"`; do
  11.     rdme="";
  12.     [ -f "$modsdir/$mod/readme.txt" ] && rdme="$modsdir/$mod/readme.txt";
  13.     [ -f "$modsdir/$mod/README.txt" ] && rdme="$modsdir/$mod/README.txt";
  14.     [ -f "$modsdir/$mod/README" ] && rdme="$modsdir/$mod/README";
  15.     if [ "$rdme" ]; then
  16.         link="`cat "$rdme" \
  17.         | grep "$mod" \
  18.         | grep 'http' \
  19.         | sed -e 's/.*\(http[^ \t]*\).*/\1/' \
  20.         | head -n 1`";
  21.         echo "$mod: $link";
  22.     fi
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement