-
Notifications
You must be signed in to change notification settings - Fork 0
/
archinstallscript2.sh
66 lines (57 loc) · 1.81 KB
/
archinstallscript2.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
#!/bin/sh
# HELLO
#
# Read this script in it's entirety before executing it.
# DO NOT EXECUTE SCRIPTS WITHOUT READING THEM FIRST.
#
# If you are not okay with any action taken by this script, press N at the next prompt, whether
# or not your drives are properly formatted.
#
# Exit this prompt by pressing q.
#
# -Slips
cat ./archinstallscript2.sh | less
echo 'Put Drive Name (example: sda, NOT /dev/sda)'
read drivename
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo Enter Hostname:
read hostname
echo $hostname > /etc/hostname
echo 127.0.0.1 localhost > /etc/hosts
echo ::1 localhost > /etc/hosts
echo 127.0.1.1 $hostname.localdomain $hostname > /etc/hosts
mkinitcpio -P
echo Set Root Password:
passwd
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
echo "Setting up non-root user, please enter username:"
read username
useradd -m -G wheel -s /bin/zsh $username
echo "Set Non-root password:"
passwd $username
echo "STOP!"
echo "This script is about to install grub for the i386-pc target. Would you like to cancel now? (Y/N)"
read cancelnow
if [ $cancelnow = Y ]; then
echo "Understood, cancelling now. Be warned you will have to exit and unmount on your own after installing grub."
exit 0
elif [ $cancelnow = y ]; then
echo "Understood, cancelling now. Be warned you will have to exit and unmount on your o
wn after installing grub."
exit 0
elif [ $cancelnow = n ]; then
echo "Continuing..."
elif [ $cancelnow = N ]; then
echo "Continuing..."
else
echo "Input no understood, presuming no, program stopping."
exit 0
fi
grub-install --target=i386-pc /dev/$drivename
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
echo And youre done! Reboot and get using!