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.

130 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
6 years ago
6 years ago
6 years ago
6 years ago
  1. # Maintainer: Pekka Helenius <fincer89@hotmail.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 # listpkg.sh, bininfo.sh, pkginfo.sh, buildpkg.sh, installlocal.sh, missinglibs.sh, nowner.sh, findpkg.sh, findinpkg.sh, pkgdeps.sh, pkgstr.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. pkgstr.sh
  43. archrisks.sh
  44. showpkg.sh
  45. deltmpfiles.sh
  46. missinglibs.sh
  47. installlocal.sh
  48. buildpkg.sh
  49. pkginfo.sh
  50. bininfo.sh
  51. listpkg.sh
  52. killprocess.sh
  53. rmpkgfiles.sh
  54. specialchars.sh
  55. whichcmd.sh
  56. killns.sh
  57. psns.sh
  58. whichport.c
  59. whichservice.c
  60. bash.custom
  61. https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS)
  62. if [[ $server_environment == "true" ]]; then
  63. # for ssh_timezone.sh
  64. depends+=(geoip2-database mmdblookup systemd openssh bind-tools)
  65. source+=(ssh_timezone.sh)
  66. fi
  67. sha256sums=('f5455279ae48739b4ce16b10061e898f80cff0c9b24100f499015cae618fb8c6'
  68. '623b794a8a537649cc434b496dbf1f018aeea99f57f11d0719f80e495ca438b6'
  69. '568dba0eb0dfe1875980484fe473bbbd4397bdc04622f6177992ee75ca1b065f'
  70. 'ed4e06ceb5aff36ea66ce9de74f5ff2236ab2f92a9419d79d6fefe5a1b013859'
  71. '60d859fead290ba0c39502a21eb093aa63b384963bf83b60d93c2fcb74655ef6'
  72. 'a3cf8e77af8a49935c3e9a579354f761ab7ca8c2f94760012b9e23a196307f8f'
  73. '6783896c716045da0e38ae11ccaac491b6166b15ef9273118dcbe662b2eca97e'
  74. 'e25a0d8b425fd3f05414b6f1f6f5fce5832bb842691dad5aff4c7ac5aaa7a9fd'
  75. '28fe6983f144e41d57589fefac6d60b84ff3b0968cc4b274276b34802ff03dd0'
  76. '67d5627b20ec75d94cb89f9f193daa8a8018d1453d387e0306c0032f5a9b6b30'
  77. 'd1427a149f7092fd2ac8e0f81167f7c4eb6a318918f96b2d5301a8b750796c5d'
  78. 'abc140033891cc4564d71e8487f6cd1e54add761417cc772652542daf7352f44'
  79. '8b76a175d7cc767519d1e3519d1fd874cc19cc529e08a27138948f8a1907ac6a'
  80. '6886176293cb3ed131dd83e2ca3aa15f70c559e265534e195fa8848f2d02f659'
  81. 'ef4574de79c82d52a2cfb57cbf19419362ab702471bd71620e5893f426d150e2'
  82. 'ac761aa82d3a369a3f5335ad8f38af6cd00181cacf24737080e6d6ed6fff1b18'
  83. '63a7b50faba7963584519f2800205d853cc02d6386362c9efd9f61154e4c9ddb'
  84. 'aa0b96ff9f1ff51e1ea3634fa7e17cbffa565c5b2db79ed75bd6aeeb9de9a723'
  85. 'fc87bd14c0638cd3c803143c371946efe2c96a87d72d2c144fbaf29a815294d3'
  86. '4baf8c7d1032cafb8535dc4d53c42b7e7f2da6839bde791c31104a3f67eb845b'
  87. 'e179f9b18d6869558a97530101502ae6b445d3ef430e2e4359d015f214292093'
  88. '1aae9db8652179e18691fd51c687ab393672f380084e8777145572a5699bf5cf'
  89. '93ee0e990f36a5641e4f9fb4ba851e3db47ff6f01fdfad8dd169b83c546ecae9'
  90. '40fd211e7b4a21ca61be81a809ee47f58adc6cd220218a20a0c7e65e1534c6ca')
  91. package() {
  92. mkdir -p "$pkgdir"/{usr/bin,etc}
  93. #cp -R "$srcdir"/"$pkgname"/*.sh "$pkgdir"/usr/bin/
  94. install -m644 "$srcdir"/LS_COLORS "$pkgdir"/etc/dircolors
  95. install -m644 "$srcdir"/bash.custom "$pkgdir"/etc/bash.custom
  96. for sh in ./*.sh; do
  97. install -m755 $sh "$pkgdir"/usr/bin/
  98. #chmod u=rwx,g=rx,o=rx $sh
  99. mv "$pkgdir"/usr/bin/$sh $(echo "$pkgdir"/usr/bin/$sh | sed 's/\.sh//')
  100. done
  101. for i in ./*.c; do
  102. gcc $i -o $(echo $i | sed 's/\.c$//')
  103. install -m755 $i "$pkgdir"/usr/bin/
  104. done
  105. msg2 '
  106. In /etc/bash.bashrc file, replace line
  107. PS1="[\\u@\\h \\W]\\$ "
  108. with
  109. [[ -f /etc/bash.custom ]] && . /etc/bash.custom || PS1="[\\u@\\h \\W]\\$ "
  110. After that, you can change bash settings globally by editing /etc/bash.custom file
  111. '
  112. #msg2 "You can change bash settings globally by editing /etc/bash.custom file"
  113. }