dnf 733 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. updatey() {
  3. if test $# = 0
  4. then
  5. apt-get -y update && apt-get -y upgrade
  6. else
  7. apt-get -y install $1
  8. fi
  9. }
  10. yes() {
  11. if test "$1" = "install"
  12. then
  13. apt-get -y install $2
  14. elif test "$1" = "upgrade"
  15. then
  16. updatey $2
  17. elif test "$1" = "remove"
  18. then
  19. apt-get -y purge $2
  20. else
  21. echo E: Invalid operation $1
  22. fi
  23. }
  24. update() {
  25. if test $# = 0
  26. then
  27. apt-get update && apt-get upgrade
  28. else
  29. apt-get install $1
  30. fi
  31. }
  32. if test "$1" = "install"
  33. then
  34. apt-get install $2
  35. elif test "$1" = "autoremove"
  36. then
  37. apt-get autoremove
  38. elif test "$1" = "upgrade"
  39. then
  40. update $2
  41. elif test "$1" = "info"
  42. then
  43. apt-cache show $2
  44. elif test "$1" = "-y"
  45. then
  46. updatey $2 $3
  47. elif test "$1" = "remove"
  48. then
  49. apt-get purge $2
  50. else
  51. echo E: Invalid operation $1
  52. fi