Advertisement
zefie

opkg-list-installed-extroot

Aug 20th, 2018
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/bin/sh
  2. mkdir /tmp/opkginstalled
  3. cp -r /rom /tmp/opkginstalled
  4. mkdir -p /tmp/opkginstalled/rom/var/lock
  5. opkg list-installed -o /tmp/opkginstalled/rom > /tmp/rom.list
  6. rm -rf /tmp/opkginstalled
  7.  
  8. opkg list-installed > /tmp/all.list
  9. awk 'FNR==NR{a[$0]++}FNR!=NR && !a[$0]{print}' /tmp/rom.list /tmp/all.list > /tmp/custom.list
  10. rm -f /tmp/final.list
  11. OLDIFS=${IFS}
  12. IFS=$'\n'
  13. for l in $(cat /tmp/custom.list); do
  14.     if [ $(grep $(echo $l | cut -d' ' -f1) /tmp/rom.list | wc -l) -eq 0 ]; then
  15.         echo $l >> /tmp/final.list
  16.     fi
  17. done
  18. IFS=${OLDIFS}
  19. cat /tmp/final.list
  20. rm /tmp/rom.list /tmp/all.list /tmp/custom.list /tmp/final.list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement