forked from AnarchyLinux/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
anarchy-installer.sh
executable file
·99 lines (84 loc) · 2.23 KB
/
anarchy-installer.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
#!/bin/bash
###############################################################
### Anarchy Linux Install Script
###
### Copyright (C) 2017 Dylan Schacht
###
### By: Dylan Schacht (deadhead)
### Email: deadhead3492@gmail.com
### Webpage: https://anarchy-linux.org
###
### Any questions, comments, or bug reports may be sent to above
### email address. Enjoy, and keep on using Arch.
###
### License: GPL v2.0
###
### This program is free software; you can redistribute it and/or
### modify it under the terms of the GNU General Public License
### as published by the Free Software Foundation; either version 2
### of the License, or (at your option) any later version.
###
### 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, write to the Free Software
### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
################################################################
init() {
if [ $(basename "$0") = "anarchy" ]; then
aa_dir="/usr/share/anarchy" # Anarchy ISO
aa_conf="/etc/anarchy.conf"
aa_lib="/usr/lib/anarchy"
else
aa_dir=$(dirname $(readlink -f "$0")) # Anarchy git repository
aa_conf="$aa_dir"/etc/anarchy.conf
aa_lib="$aa_dir"/lib
fi
trap '' 2
for file in $(ls "$aa_lib") ; do
source "$aa_lib"/"$file"
done
source "$aa_conf"
language
source "$lang_file"
source "$aa_conf"
export reload=true
}
main() {
update_mirrors
check_connection
set_keys
set_locale
set_zone
prepare_drives
install_options
set_hostname
set_user
add_software
install_base
configure_system
add_user
reboot_system
}
dialog() {
if "$screen_h" ; then
if "$LAPTOP" ; then
backtitle="$backtitle $(acpi)"
fi
/usr/bin/dialog --colors --backtitle "$backtitle" --title "$op_title" "$@"
else
/usr/bin/dialog --colors --title "$title" "$@"
fi
}
if [ "$UID" -ne "0" ]; then
echo "Error: anarchy requires root privilege"
echo " Use: sudo anarchy"
exit 1
fi
opt="$1"
init
main
# vim: ai:ts=8:sw=8:sts=8:noet