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.

129 lines
4.6 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 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. dummypkg.sh
  43. archrisks.sh
  44. showpkg.sh
  45. deltmpfiles.sh
  46. missinglibs.sh
  47. buildpkg.sh
  48. pkginfo.sh
  49. bininfo.sh
  50. killprocess.sh
  51. specialchars.sh
  52. whichcmd.sh
  53. killns.sh
  54. psns.sh
  55. whichport.c
  56. whichservice.c
  57. bash.custom
  58. https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS)
  59. if [[ $server_environment == "true" ]]; then
  60. # for ssh_timezone.sh
  61. depends+=(geoip2-database mmdblookup systemd openssh bind-tools)
  62. source+=(ssh_timezone.sh)
  63. fi
  64. sha256sums=('891d763f852d3a61216a384a15ca01c57178d3a5fea8aa858de0643998e9ba58'
  65. '3af9ef2fc156d2c62753f1bf902e31ce84fb5c7ccd3d978b176047ab281e2f08'
  66. '7bdfc3ec70ebb91b330f2239a86a6f7394c8c82b51263e5e96839f5f896707da'
  67. 'c96b43cc49e6872cdd3b6e51cb490ca8ea2d990f2c3545bed106a21df86648eb'
  68. '3bfac88603fe0f19383bc8b1ca7e2bc6795a90e851eaefd0758d515edd916100'
  69. '3cf521359e473256a52e2a9fbcbfa3f0d39f42befa2d9a79cb7c51372f925c7b'
  70. '89d421e4981e0907b9095165631791ac034c0d33a215a71c21a59acbf2c41480'
  71. '1424ad779f5f673c01ac2845f5e3749b7c7b47dfdaa173bd45c4e866dfa4da22'
  72. '7493ff8f2321b04fab6c4b743a15708d9aca4383ce0c934c6ed4d091f1dfd76f'
  73. '0524c509b1378dd275c8e396bcafb6df9de48248739c528bc335f879c4b08bfc'
  74. '6290400b493a6e498ffe4a457274c3c4da4de60f5f3043cb36d08c9ca29cce63'
  75. '4a9693bdc1d6a10e54266bf7b3d440e926d66c61ef6d18774a2db951aa4dd478'
  76. '8bbcb61e6283bda4988468271cbaee0d7c537342a095466b4ea309bcb782eaf2'
  77. 'ca1aae07f32fd9ba2a05ffa107d1ac97638578c9926359b323be56d911b54c17'
  78. '845c3f8c0069d7938f800fe6c2e473fd1359c0fd17a5c37cbd89bbcb89c10ae7'
  79. '7aaceffb2da0d56c00c0900f202ab3593bd8ce246c894303765875262ed3c606'
  80. 'ae13b022053b6a3d2977fac8fbf036b09dfcf107c20f9c97577a573cecc01de0'
  81. '434aa1eed4088f9bf86cef1f186b6444166e9d8367d4666a79d5c9edcf8dac2e'
  82. 'e5b8a59bcaa430f28bdd6503d4e34e57e44e429000c046d16caddcaa0fa5a30f'
  83. '96c0a6093ddc3c6946cd6aa2ce038a046bf658b834c2fe8f4e8a1c40b3149453'
  84. '6df52b55e5b7471d07fe2e2a6b40ddb2972bb7ff9e60911bd4f5fcdb0e07c860'
  85. 'ded8bbcb0267632bdbeb100468b412911f5b0d32541744acff94a81bc346c17d'
  86. '4d5a0fc2b8817f17d9f180a28970dfcd14b5aea2f0164bd6fbfed145bd009d29'
  87. '30ec1a5143e9b3353e34427539abd5e5b52e2c43e3e9dd730f566362caff2c9e'
  88. '93ee0e990f36a5641e4f9fb4ba851e3db47ff6f01fdfad8dd169b83c546ecae9'
  89. '40fd211e7b4a21ca61be81a809ee47f58adc6cd220218a20a0c7e65e1534c6ca')
  90. package() {
  91. mkdir -p "$pkgdir"/{usr/bin,etc}
  92. #cp -R "$srcdir"/"$pkgname"/*.sh "$pkgdir"/usr/bin/
  93. install -m644 "$srcdir"/LS_COLORS "$pkgdir"/etc/dircolors
  94. install -m644 "$srcdir"/bash.custom "$pkgdir"/etc/bash.custom
  95. for sh in ./*.sh; do
  96. install -m755 $sh "$pkgdir"/usr/bin/
  97. #chmod u=rwx,g=rx,o=rx $sh
  98. mv "$pkgdir"/usr/bin/$sh $(echo "$pkgdir"/usr/bin/$sh | sed 's/\.sh//')
  99. done
  100. for i in ./*.c; do
  101. gcc $i -o $(echo $i | sed 's/\.c$//')
  102. install -m755 $i "$pkgdir"/usr/bin/
  103. done
  104. msg2 '
  105. In /etc/bash.bashrc file, replace line
  106. PS1="[\\u@\\h \\W]\\$ "
  107. with
  108. [[ -f /etc/bash.custom ]] && . /etc/bash.custom || PS1="[\\u@\\h \\W]\\$ "
  109. After that, you can change bash settings globally by editing /etc/bash.custom file
  110. '
  111. #msg2 "You can change bash settings globally by editing /etc/bash.custom file"
  112. }