Advertisement
nkk71

my_if example

Feb 25th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. my_if() {
  2. if $@; then
  3. ui_print2 "OK";
  4. else
  5. ui_print2 "error";
  6. abort; return 1;
  7. fi;
  8. }
  9.  
  10. abort() {
  11. rm -rf /tmp/AIK-mobile;
  12. ui_print "---------------------------------------";
  13. ui_print "Me no like ... aborting";
  14. ui_print " ";
  15. ui_print "!!nothing was changed!!";
  16. ui_print "=======================================";
  17. exit 1;
  18. }
  19.  
  20.  
  21. ui_print1 "Extracting files...";
  22. my_if mkdir -p /tmp/AIK-mobile && cd /tmp/AIK-mobile && unzip -o "$ZIP" && cd /tmp/AIK-mobile/AIK;
  23.  
  24. ui_print1 "Pulling current kernel...";
  25. my_if dd if=$bootP of=/tmp/AIK-mobile/AIK/oldboot.img;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement