Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
3 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # Maintainer: Pekka Helenius <pekka[dot]helenius[at]fjordtek[dot]com>
  2. # Do we include server-specific files such as SSH timezone settings?
  3. server_environment=false
  4. if [[ $server_environment == "true" ]]; then
  5. pkgname=archtools-server
  6. pkgdesc="Useful scripts for Arch Linux (server)"
  7. conflicts=(archtools)
  8. else
  9. pkgname=archtools
  10. pkgdesc="Useful scripts for Arch Linux"
  11. conflicts=(archtools-server)
  12. fi
  13. pkgver=0.1
  14. pkgrel=1
  15. url="https://github.com/Fincer/archtools"
  16. arch=(any)
  17. license=(GPL)
  18. depends=(coreutils bash grep sed
  19. pacman # bininfo.sh, pkginfo.sh, buildpkg.sh, installlocal.sh, missinglibs.sh, nowner.sh, findpkg.sh, findinpkg.sh, pkgdeps.sh, risks.sh, showpkg.sh
  20. perl # findpkg.sh, genmac.sh
  21. wget # getsource.sh
  22. file # nowner.sh
  23. which iputils 9base package-query # pkgdeps.sh (9base = read command) #mimetype TODO get rid of this dependency
  24. tar xz bzip2 unrar gzip unzip p7zip cabextract #extract.sh
  25. arch-audit bc # risks.sh
  26. glibc # missinglibs.sh
  27. util-linux # killprocess.sh (kill command)
  28. stderred # bash.custom LD_PRELOAD
  29. gcc
  30. )
  31. makedepends=(git)
  32. source=(
  33. tputcolors.sh
  34. extract.sh
  35. findmatch.sh
  36. findpkg.sh
  37. findinpkg.sh
  38. genmac.sh
  39. getsource.sh # TODO: More implementation needed. See the file for details
  40. nowner.sh # TODO: More implementation needed. See the file for details
  41. pkgdeps.sh # TODO: More implementation needed. See the file for details
  42. archrisks.sh
  43. showpkg.sh
  44. deltmpfiles.sh
  45. missinglibs.sh
  46. buildpkg.sh
  47. pkginfo.sh
  48. bininfo.sh
  49. killprocess.sh
  50. specialchars.sh
  51. whichcmd.sh
  52. killns.sh
  53. psns.sh
  54. whichport.c
  55. whichservice.c
  56. bash.custom
  57. https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS)
  58. if [[ $server_environment == "true" ]]; then
  59. # for ssh_timezone.sh
  60. depends+=(geoip2-database mmdblookup systemd openssh bind-tools)
  61. source+=(ssh_timezone.sh)
  62. fi
  63. sha256sums=('891d763f852d3a61216a384a15ca01c57178d3a5fea8aa858de0643998e9ba58'
  64. '3af9ef2fc156d2c62753f1bf902e31ce84fb5c7ccd3d978b176047ab281e2f08'
  65. '7bdfc3ec70ebb91b330f2239a86a6f7394c8c82b51263e5e96839f5f896707da'
  66. 'c96b43cc49e6872cdd3b6e51cb490ca8ea2d990f2c3545bed106a21df86648eb'
  67. '3bfac88603fe0f19383bc8b1ca7e2bc6795a90e851eaefd0758d515edd916100'
  68. '3cf521359e473256a52e2a9fbcbfa3f0d39f42befa2d9a79cb7c51372f925c7b'
  69. '8ed38b8f9020280a29999a524f1ad6fb1145d4f00827df45b256bf5eb5a450a1'
  70. '1424ad779f5f673c01ac2845f5e3749b7c7b47dfdaa173bd45c4e866dfa4da22'
  71. '7493ff8f2321b04fab6c4b743a15708d9aca4383ce0c934c6ed4d091f1dfd76f'
  72. '6290400b493a6e498ffe4a457274c3c4da4de60f5f3043cb36d08c9ca29cce63'
  73. '4a9693bdc1d6a10e54266bf7b3d440e926d66c61ef6d18774a2db951aa4dd478'
  74. '8bbcb61e6283bda4988468271cbaee0d7c537342a095466b4ea309bcb782eaf2'
  75. 'ca1aae07f32fd9ba2a05ffa107d1ac97638578c9926359b323be56d911b54c17'
  76. '845c3f8c0069d7938f800fe6c2e473fd1359c0fd17a5c37cbd89bbcb89c10ae7'
  77. '7aaceffb2da0d56c00c0900f202ab3593bd8ce246c894303765875262ed3c606'
  78. 'ae13b022053b6a3d2977fac8fbf036b09dfcf107c20f9c97577a573cecc01de0'
  79. '434aa1eed4088f9bf86cef1f186b6444166e9d8367d4666a79d5c9edcf8dac2e'
  80. 'e5b8a59bcaa430f28bdd6503d4e34e57e44e429000c046d16caddcaa0fa5a30f'
  81. '96c0a6093ddc3c6946cd6aa2ce038a046bf658b834c2fe8f4e8a1c40b3149453'
  82. '6df52b55e5b7471d07fe2e2a6b40ddb2972bb7ff9e60911bd4f5fcdb0e07c860'
  83. 'ded8bbcb0267632bdbeb100468b412911f5b0d32541744acff94a81bc346c17d'
  84. '4d5a0fc2b8817f17d9f180a28970dfcd14b5aea2f0164bd6fbfed145bd009d29'
  85. '30ec1a5143e9b3353e34427539abd5e5b52e2c43e3e9dd730f566362caff2c9e'
  86. '93ee0e990f36a5641e4f9fb4ba851e3db47ff6f01fdfad8dd169b83c546ecae9'
  87. '40fd211e7b4a21ca61be81a809ee47f58adc6cd220218a20a0c7e65e1534c6ca')
  88. package() {
  89. mkdir -p "$pkgdir"/{usr/bin,etc}
  90. #cp -R "$srcdir"/"$pkgname"/*.sh "$pkgdir"/usr/bin/
  91. install -m644 "$srcdir"/LS_COLORS "$pkgdir"/etc/dircolors
  92. install -m644 "$srcdir"/bash.custom "$pkgdir"/etc/bash.custom
  93. for sh in ./*.sh; do
  94. install -m755 $sh "$pkgdir"/usr/bin/
  95. #chmod u=rwx,g=rx,o=rx $sh
  96. mv "$pkgdir"/usr/bin/$sh $(echo "$pkgdir"/usr/bin/$sh | sed 's/\.sh//')
  97. done
  98. for i in ./*.c; do
  99. gcc $i -o $(echo $i | sed 's/\.c$//')
  100. install -m755 $i "$pkgdir"/usr/bin/
  101. done
  102. msg2 '
  103. In /etc/bash.bashrc file, replace line
  104. PS1="[\\u@\\h \\W]\\$ "
  105. with
  106. [[ -f /etc/bash.custom ]] && . /etc/bash.custom || PS1="[\\u@\\h \\W]\\$ "
  107. After that, you can change bash settings globally by editing /etc/bash.custom file
  108. '
  109. #msg2 "You can change bash settings globally by editing /etc/bash.custom file"
  110. }