Guest User

Untitled

a guest
Sep 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. read -p "Please input username:" USERNAME
  4.  
  5. if [ ! -f "/bin/zsh" ]; then
  6. apt-get install zsh
  7. fi
  8.  
  9. useradd -U -s /bin/zsh -m $USERNAME
  10. passwd $USERNAME
  11.  
  12. # to modify group
  13. # usermod -a -G group1,group2,group3 username
  14. # to show groups
  15. # groups username
  16.  
  17. cat <<'EOF' > /home/$USERNAME/.zshrc
  18. # Lines configured by zsh-newuser-install
  19. HISTFILE=~/.histfile
  20. HISTSIZE=1000
  21. SAVEHIST=1000
  22. bindkey -v
  23. # End of lines configured by zsh-newuser-install
  24. # The following lines were added by compinstall
  25. zstyle :compinstall filename '/home/$USERNAME/.zshrc'
  26.  
  27. autoload -Uz compinit
  28. compinit
  29. # End of lines added by compinstall
  30.  
  31. PROMPT="%{$fg[green]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$reset_color%} %1~>"
  32. RPROMPT="%{$fg[blue]%}%~%{$reset_color%} %{$fg[green]%}[%?]%{$reset_color%}%{$fg[blue]%}%T%{$reset_color%}"
  33.  
  34. alias rm='rm -i'
  35. alias ls='ls --color'
  36. alias wget='axel'
  37.  
  38. EDITOR=vim
  39. EOF
Add Comment
Please, Sign In to add comment