installation scripts for servers.
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.

88 lines
2.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #!/bin/sh
  2. DIR="$(realpath "$(dirname "$0")")"
  3. # script must start at home directory
  4. cd "$HOME" || exit 1;
  5. usertest() {
  6. if test "$(id -u)" -eq 0; then
  7. echo "You cannot run this script as root.";
  8. exit 1;
  9. fi
  10. if ! (type sudo 2>&1) > /dev/null; then
  11. echo "sudo is not installed.";
  12. exit 1
  13. fi
  14. echo "Updating DNF"
  15. sudo dnf -y update || exit 1
  16. sudo dnf -y upgrade || exit 1
  17. }
  18. dev() {
  19. echo "Developer tools..."
  20. sudo dnf install -y git make python3 nodejs npm neovim curl
  21. }
  22. sysinfo() {
  23. echo "Dylan Araps scripts"
  24. cd "$HOME" || exit 1;
  25. mkdir -p repos
  26. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  27. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  28. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  29. cd "$HOME/repos/pfetch" || exit 1;
  30. sudo make install || exit 2;
  31. cd "$HOME" || exit 1;
  32. cd "$HOME/repos/neofetch" || exit 1;
  33. sudo make install || exit 2;
  34. cd "$HOME" || exit 1;
  35. cd "$HOME/repos/fff" || exit 1;
  36. sudo make install || exit 2;
  37. cd "$HOME" || exit 1;
  38. }
  39. shell() {
  40. sudo dnf install -y zsh starship
  41. }
  42. browsers() {
  43. sudo dnf remove -y firefox
  44. sudo dnf install -y chromium torbrowser-launcher
  45. }
  46. # neovim must be installed.
  47. plugins() {
  48. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  49. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  50. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  51. sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  52. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  53. }
  54. dotfiles() {
  55. echo "Adding vim and zsh configs"
  56. if ! test -d "$DIR/dotfiles"; then
  57. echo "$DIR/dotfiles folder not found.";
  58. exit 1;
  59. fi
  60. mkdir -p "$HOME/.config/nvim"
  61. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  62. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  63. nvim --headless +PlugInstall +qa
  64. }
  65. competitiveprogramming() {
  66. echo "CP Compilers..."
  67. sudo dnf install clang clang-tools-extra
  68. cd "$HOME" || exit 1;
  69. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  70. }
  71. (usertest && dev && sysinfo && shell && browsers && plugins && dotfiles) || exit 1