summaryrefslogtreecommitdiff
path: root/docker-vyos/vyos_install_stage_03.sh
blob: e51ff0899b6d4f156b799c05f426f13525a61ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash

# Copyright (C) 2020-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Stage 3 - tune the system

# load common functions
. vyos_install_common.sh

# Add config partition marker
mkdir -p /opt/vyatta/etc/config
touch /opt/vyatta/etc/config/.vyatta_config

# create folder for configuration mounting
ln -s /opt/vyatta/etc/config /config

# Delete SSH keys
rm -rf /etc/ssh/ssh_host_*

# Fix FUSE settings
sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf

# Configure locale
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
dpkg-reconfigure locales
update-locale LANG=en_US.UTF-8 LC_ALL=C

# Tune bash and environment settings
echo "source /etc/bash_completion" >> /root/.bashrc
sed -i 's/set $BASH_COMPLETION_ORIGINAL_V_VALUE/builtin set $BASH_COMPLETION_ORIGINAL_V_VALUE/g' /usr/share/bash-completion/bash_completion

# Run configuration hooks
echo "Running system configuration hooks"
hooks_list=(
    "18-enable-disable_services.chroot"
    "30-frr-configs.chroot"
    )
for hook in ${hooks_list[@]}; do
    if [[ -e /tmp/hooks/${hook} ]]; then
        echo "Running ${hook}"
        /tmp/hooks/${hook}
    fi
done

# Delete needless options from CLI
 CLI_DELETION=(
     "/opt/vyatta/share/vyatta-cfg/templates/container/"
     )
 rm -rf ${CLI_DELETION[@]}

exit 0