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.

119 lines
4.2 KiB

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, 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. libetc # bash.custom LD_PRELOAD
  30. )
  31. makedepends=(git)
  32. source=(
  33. tputcolors.sh
  34. extract.sh
  35. findmatch.sh
  36. findpkg.sh
  37. genmac.sh
  38. getsource.sh # TODO: More implementation needed. See the file for details
  39. nowner.sh # TODO: More implementation needed. See the file for details
  40. pkgdeps.sh # TODO: More implementation needed. See the file for details
  41. pkgstr.sh
  42. archrisks.sh
  43. showpkg.sh
  44. deltmpfiles.sh
  45. missinglibs.sh
  46. installlocal.sh
  47. buildpkg.sh
  48. pkginfo.sh
  49. bininfo.sh
  50. listpkg.sh
  51. killprocess.sh
  52. rmpkgfiles.sh
  53. specialchars.sh
  54. bash.custom
  55. https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS)
  56. if [[ $server_environment == "true" ]]; then
  57. # for ssh_timezone.sh
  58. depends+=(geoip2-database mmdblookup systemd openssh bind-tools)
  59. source+=(ssh_timezone.sh)
  60. fi
  61. sha256sums=('623b794a8a537649cc434b496dbf1f018aeea99f57f11d0719f80e495ca438b6'
  62. '568dba0eb0dfe1875980484fe473bbbd4397bdc04622f6177992ee75ca1b065f'
  63. 'ed4e06ceb5aff36ea66ce9de74f5ff2236ab2f92a9419d79d6fefe5a1b013859'
  64. 'a3cf8e77af8a49935c3e9a579354f761ab7ca8c2f94760012b9e23a196307f8f'
  65. '047bbe110d75a6e44f427675134c0594bc413efd57ca16836ff1acd607601c10'
  66. 'a56c4e7b99078da4324c425fe4da5dc7c10c55d7fac62c8d23a86cfcf4abae0e'
  67. '4b1015e10c0f4e4e9e0dd64533aea1ffe914f3ce6760bf6293f056b4069a4f37'
  68. '67d5627b20ec75d94cb89f9f193daa8a8018d1453d387e0306c0032f5a9b6b30'
  69. '88e37be0de270d023712d4bae852c54292541ca5510d09c5a1316fa5958f117c'
  70. 'abc140033891cc4564d71e8487f6cd1e54add761417cc772652542daf7352f44'
  71. '8b76a175d7cc767519d1e3519d1fd874cc19cc529e08a27138948f8a1907ac6a'
  72. '6886176293cb3ed131dd83e2ca3aa15f70c559e265534e195fa8848f2d02f659'
  73. 'ef4574de79c82d52a2cfb57cbf19419362ab702471bd71620e5893f426d150e2'
  74. 'ac761aa82d3a369a3f5335ad8f38af6cd00181cacf24737080e6d6ed6fff1b18'
  75. '63a7b50faba7963584519f2800205d853cc02d6386362c9efd9f61154e4c9ddb'
  76. 'aa0b96ff9f1ff51e1ea3634fa7e17cbffa565c5b2db79ed75bd6aeeb9de9a723'
  77. 'fc87bd14c0638cd3c803143c371946efe2c96a87d72d2c144fbaf29a815294d3'
  78. '4baf8c7d1032cafb8535dc4d53c42b7e7f2da6839bde791c31104a3f67eb845b'
  79. 'e179f9b18d6869558a97530101502ae6b445d3ef430e2e4359d015f214292093'
  80. '1aae9db8652179e18691fd51c687ab393672f380084e8777145572a5699bf5cf'
  81. '594453fefd07471e4aa167c486c77fbf589c5ee838cb0f33d3b5399fabff5ee6'
  82. '40fd211e7b4a21ca61be81a809ee47f58adc6cd220218a20a0c7e65e1534c6ca')
  83. package() {
  84. mkdir -p "$pkgdir"/{usr/bin,etc}
  85. #cp -R "$srcdir"/"$pkgname"/*.sh "$pkgdir"/usr/bin/
  86. install -m644 "$srcdir"/LS_COLORS "$pkgdir"/etc/dircolors
  87. install -m644 "$srcdir"/bash.custom "$pkgdir"/etc/bash.custom
  88. for sh in ./*.sh; do
  89. install -m755 $sh "$pkgdir"/usr/bin/
  90. #chmod u=rwx,g=rx,o=rx $sh
  91. mv "$pkgdir"/usr/bin/$sh $(echo "$pkgdir"/usr/bin/$sh | sed 's/\.sh//')
  92. done
  93. msg2 '
  94. In /etc/bash.bashrc file, replace line
  95. PS1="[\\u@\\h \\W]\\$ "
  96. with
  97. [[ -f /etc/bash.custom ]] && . /etc/bash.custom || PS1="[\\u@\\h \\W]\\$ "
  98. After that, you can change bash settings globally by editing /etc/bash.custom file
  99. '
  100. #msg2 "You can change bash settings globally by editing /etc/bash.custom file"
  101. }