-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrootfs-setup.sh
More file actions
43 lines (31 loc) · 1.24 KB
/
rootfs-setup.sh
File metadata and controls
43 lines (31 loc) · 1.24 KB
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
#!/bin/bash
source install.conf
echo "======================================================================"
echo "========================= Setting Up Rootfs =========================="
echo "======================================================================"
#Set the timezone
read -p "Enter your timezone in the format(Continent/Region) [Default => Asia/Kolkata]:-" TIMEZONE
TIMEZONE=${TIMEZONE:-"Asia/Kolkata"}
ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
hwclock --systohc
#Setting up the locale
sed -i "s/^#${LANGUAGE}/${LANGUAGE}/" /etc/locale.gen
locale-gen
echo "en_IN.UTF-8" > /etc/locale.conf
#Setting up Hostname
echo $HOSTNAME > /etc/hostname
#Setting up network configuration
echo "
127.0.0.1 localhost
::1 localhost
127.0.0.1 ${HOSTNAME}.localdomain ${HOSTNAME}
" > /etc/hosts
#
#Setting Passwords
echo "root:${PASSWORD}" | chpasswd
useradd -mG wheel ${USERNAME}
echo "${USERNAME}:${PASSWORD}" | chpasswd
sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
echo "======================================================================"
echo "======================= Setting Up Complete =========================="
echo "======================================================================"