]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/firstsetup
suricata: Change midstream policy to "pass-flow"
[ipfire-2.x.git] / src / initscripts / system / firstsetup
1 #!/bin/bash
2 ###############################################################################
3 # #
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
6 # #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
11 # #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
16 # #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 # #
20 ###############################################################################
21
22 # Exit if firstsetup was already done...
23 if [ -e /var/ipfire/main/firstsetup_ok ]; then
24 exit 0;
25 fi
26
27 # disable consoles if tty are not present
28 openvt -f -w -- /bin/sh -c echo > /dev/null 2>&1
29 if [ ! "${?}" == "0" ]; then
30 # Disable console on tty2-6
31 sed -i -e "s|2:2345:respawn:|#2:2345:respawn:|g" /etc/inittab
32 sed -i -e "s|3:2345:respawn:|#3:2345:respawn:|g" /etc/inittab
33 sed -i -e "s|4:2345:respawn:|#4:2345:respawn:|g" etc/inittab
34 sed -i -e "s|5:2345:respawn:|#5:2345:respawn:|g" /etc/inittab
35 sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" /etc/inittab
36 fi
37
38 # reload inittab
39 /sbin/init q
40 #
41 /etc/init.d/sysklogd start
42 export LANG=en_US.utf8
43 /usr/sbin/setup /dev/tty2 INSTALL
44 if [ "${?}" == "1" ]; then
45 echo Setup not finished. Rebooting ...
46 reboot -f
47 fi
48
49 /etc/init.d/sysklogd stop
50 touch /var/ipfire/main/firstsetup_ok