forked from Nikita240/bash_files_mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
64 lines (44 loc) · 1.61 KB
/
init.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
#!/bin/bash
#
#
# ------------------------------------------------------------------------------
#
# Initialization file
# -------------------
# The following is done here:
# - OS detection, value is written to _bf_ostype
# - Sourcing of all the needed dirs/files in the correct order:
# - Load start screen /lib/start_screen.sh
# - Unset unneeded variables
#
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Source dir/files according to pattern
# Usage: _source_files, declare $files outside function, passing over
# to function does not work since it will be treated as string literal
# ------------------------------------------------------------------------------
_source_files()
{
for file in $files; do
source $file
# Debug only: printf $file$'\n'
done
unset file
}
# ------------------------------------------------------------------------------
# 1. Load /lib/pre_base*.sh files
files=~/.bash_startscreen/lib/pre_base*.sh; _source_files
# 3. Load base files
files=~/.bash_startscreen/lib/base*.sh; _source_files
# ------------------------------------------------------------------------------
_bf_detect_os_type
_bf_get_hostname
_bf_get_ext_ip
# ------------------------------------------------------------------------------
# Load Start screen
files=~/.bash_startscreen/lib/start_screen_functions.sh; _source_files
files=~/.bash_startscreen/lib/start_screen.sh; _source_files
# ------------------------------------------------------------------------------
# Cleanup variables
#
unset files