apk 597 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. yes(){
  3. if test "$1" = "add"
  4. then
  5. apt-get -y install ${@:2}
  6. elif test "$1" = "update"
  7. then
  8. apt-get -y update
  9. elif test "$1" = "del"
  10. then
  11. apt-get -y purge ${@:2}
  12. elif test "$1" = "upgrade"
  13. then
  14. apt-get -y upgrade
  15. else
  16. echo E: Invalid operation $1
  17. fi
  18. }
  19. if test "$1" = "-i"
  20. then
  21. yes $2 ${@:3}
  22. exit
  23. fi
  24. if test "$1" = "add"
  25. then
  26. apt-get install ${@:2}
  27. elif test "$1" = "update"
  28. then
  29. apt-get update
  30. elif test "$1" = "del"
  31. then
  32. apt-get purge ${@:2}
  33. elif test "$1" = "search"
  34. then
  35. apt-cache search $2
  36. elif test "$1" = "upgrade"
  37. then
  38. apt-get upgrade
  39. else
  40. echo E: Invalid operation $1
  41. fi