-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter09-systemd.sh
110 lines (93 loc) · 2.35 KB
/
chapter09-systemd.sh
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
#
if [ $UID -ne 0 ]; then echo Please run this script as root.; exit 1; fi
# if using systemd-networkd uncomment the following line
#ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf
cat > /etc/resolv.conf << "EOF"
# Generated by NetworkManager
# /etc/resolv.conf.head can replace this line
search mynet
nameserver 192.168.1.1
nameserver fe80::1%wlp37s0
# /etc/resolv.conf.tail can replace this line
# End /etc/resolv.conf
EOF
# unhash the next line if using systemd-networkd for network configuration
#ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf
cat > /etc/hosts << "EOF"
# Begin /etc/hosts
127.0.0.1 localhost
127.0.1.1 pc
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# End /etc/hosts
EOF
echo "pc" > /etc/hostname
cat > /etc/locale.conf << "EOF"
# Begin /etc/locale.conf
LANG=en_US.UTF-8
LC_COLLATE=C
# End /etc/locale.conf
EOF
# hardware clock set to local time
cat > /etc/adjtime << "EOF"
0.0 0 0.0
0
LOCAL
EOF
cat > /etc/profile << "EOF"
# Begin /etc/profile
LANG=en_US.UTF-8
# End /etc/profile
EOF
cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc
# Modified by Chris Lynn <roryo@roryo.dynup.net>
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
set meta-flag On
set input-meta On
# Turns off 8th bit stripping
set convert-meta Off
# Keep the 8th bit for display
set output-meta On
# none, visible or audible
set bell-style none
# All of the following map the escape sequence of the value
# contained in the 1st argument to the readline specific functions
"\eOd": backward-word
"\eOc": forward-word
# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for Konsole
"\e[H": beginning-of-line
"\e[F": end-of-line
# End /etc/inputrc
EOF
cat > /etc/shells << "EOF"
# Begin /etc/shells
/bin/sh
/bin/bash
# End /etc/shells
EOF
# disable screen clearance at boot time
mkdir -pv /etc/systemd/system/getty@tty1.service.d
cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF
[Service]
TTYVTDisallocate=no
EOF
umask 0022
echo "Now run makeFstab.sh to create /etc/fstab"