Guest User

Untitled

a guest
May 27th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3.  
  4. POWERS_FILES=`ls upgrade-files/rootfs/etc/config/powers.default.*`
  5.  
  6. if [ "$1" = "restore" ]; then
  7. git checkout -- upgrade-files/rootfs/etc/microbt_release
  8. git checkout -- upgrade-rootfs/allwinner-rootfs/etc/microbt_release
  9. git checkout -- upgrade-rootfs/zynq-rootfs/etc/microbt_release
  10.  
  11. for file in $POWERS_FILES
  12. do
  13. if [ -f "$file" ]; then
  14. git checkout -- $file
  15. filename=`echo $file | sed 's/upgrade-files\/rootfs\///g'`
  16. git checkout -- upgrade-rootfs/allwinner-rootfs/$filename
  17. git checkout -- upgrade-rootfs/zynq-rootfs/$filename
  18. fi
  19. done
  20. else
  21. for file in $POWERS_FILES
  22. do
  23. if [ -f "$file" ]; then
  24. sed -i '' "s/:1:/:0:/" $file
  25. fi
  26. done
  27.  
  28. sed -i '' "s/.1'/.2'/g" upgrade-files/rootfs/etc/microbt_release
  29. fi
Add Comment
Please, Sign In to add comment