gemini & tmux setup separated into functions
This commit is contained in:
32
add_user.sh
32
add_user.sh
@@ -38,8 +38,9 @@ mkdir -p /home/$LOGIN/.config/weechat/
|
|||||||
|
|
||||||
cp /root/helpers/irc.conf /home/$LOGIN/.config/weechat
|
cp /root/helpers/irc.conf /home/$LOGIN/.config/weechat
|
||||||
|
|
||||||
mkdir -p /home/$LOGIN/.config/tmux
|
setup_tmux () {
|
||||||
cat << EOF > /home/$LOGIN/.config/tmux/tmux.conf
|
mkdir -p /home/"$LOGIN"/.config/tmux
|
||||||
|
cat << EOF > /home/"$LOGIN"/.config/tmux/tmux.conf
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
setw -g mode-keys vi
|
setw -g mode-keys vi
|
||||||
bind -n F1 select-window -t 0
|
bind -n F1 select-window -t 0
|
||||||
@@ -57,8 +58,23 @@ if-shell "tmux has-session -t main 2>/dev/null" "detach" \
|
|||||||
set-hook -g client-attached "send-keys -t main:2 '/usr/local/bin/tylda-motd.sh' C-m"
|
set-hook -g client-attached "send-keys -t main:2 '/usr/local/bin/tylda-motd.sh' C-m"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
cat << EOF > /home/$LOGIN/.profile
|
setup_gemini () {
|
||||||
|
gmi="/home/$LOGIN/public_gemini/"
|
||||||
|
mkdir -p "$gmi"
|
||||||
|
ln -s "$gmi" "/srv/gemini/~$LOGIN"
|
||||||
|
|
||||||
|
cat <<EOF > "$gmi/index.gmi"
|
||||||
|
# $LOGIN
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_neomutt
|
||||||
|
setup_tmux
|
||||||
|
setup_gemini
|
||||||
|
|
||||||
|
cat << EOF > "/home/$LOGIN/.profile"
|
||||||
if [ -z "\$TMUX" ]; then
|
if [ -z "\$TMUX" ]; then
|
||||||
exec tmux attach -t main || exec tmux new -s main
|
exec tmux attach -t main || exec tmux new -s main
|
||||||
fi
|
fi
|
||||||
@@ -74,16 +90,6 @@ echo "+cpu +memory" > "$CG_ROOT/cgroup.subtree_control" 2>/dev/null || true
|
|||||||
USER_CG="$CG_ROOT/$LOGIN"
|
USER_CG="$CG_ROOT/$LOGIN"
|
||||||
mkdir "$USER_CG"
|
mkdir "$USER_CG"
|
||||||
|
|
||||||
# gemini
|
|
||||||
gmi="/home/$LOGIN/public_gemini/"
|
|
||||||
mkdir -p $gmi
|
|
||||||
ln -s $gmi /srv/gemini/~$LOGIN
|
|
||||||
|
|
||||||
cat <<EOF > $gmi/index.gmi
|
|
||||||
# $LOGIN
|
|
||||||
EOF
|
|
||||||
# end gemini
|
|
||||||
|
|
||||||
mkdir -p /home/$LOGIN/.ssh
|
mkdir -p /home/$LOGIN/.ssh
|
||||||
mkdir -p /home/$LOGIN/.gnupg
|
mkdir -p /home/$LOGIN/.gnupg
|
||||||
touch /home/$LOGIN/public_html/.webring
|
touch /home/$LOGIN/public_html/.webring
|
||||||
|
|||||||
Reference in New Issue
Block a user