fix vpn host naming
[distro-setup] / ssh-emacs-setup
1 #!/bin/bash
2 # Copyright (C) 2016 Ian Kelling
3
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7
8 # http://www.apache.org/licenses/LICENSE-2.0
9
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 if [[ $EUID != 0 ]]; then
17 sudo "$0"
18 exit
19 fi
20 if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi
21
22
23 set -eE -o pipefail
24 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
25
26 cd $(dirname $0)
27 teeu /etc/ssh/ssh_config 'SendEnv INSIDE_EMACS BRC COLUMNS'
28 ## note, duplicated in /a/bin/fai/fai/config/scripts/GRUB_PC/11-iank
29 teeu /etc/ssh/sshd_config 'AcceptEnv INSIDE_EMACS BRC COLUMNS'
30 # get rid of useless motd stuff
31 sed -i --follow-symlinks 's/^\s*PrintLastLog .*/PrintLastLog no/' /etc/ssh/sshd_config
32 rm -f /etc/update-motd.d/10-help-text /etc/update-motd.d/00-header
33
34
35 if isdeb; then
36 # fyi: debconf-set-selections doesn't like mixing tabs and spaces
37 echo "debconf debconf/frontend select Readline" | debconf-set-selections
38 service ssh reload
39 else
40 systemctl reload sshd
41 fi