-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·48 lines (38 loc) · 844 Bytes
/
run
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
#!/usr/bin/bash
# BASH PROPRETIES
## Exit immediately if a command exits with a non-zero status
set -e
## Treat unset variables as an error when substituting
set -u
## Error in pipeline will be shown
set -o pipefail
# RUNASROOT
[ "${EUID}" != "0" ] && { echo "Error: run as root"; exit 1; }
declare -x WHOAMI
WHOAMI="$(who mom likes | awk '{print $1}')"
declare -x WHOAMI_HOME
WHOAMI_HOME="$(grep ${WHOAMI} /etc/passwd | cut -d: -f6)"
# Config
declare -x PATH_BASE
PATH_BASE="$(realpath "${BASH_SOURCE[0]}")"
declare -x DIR_BASE="${PATH_BASE%/*}"
# Source config
source "${DIR_BASE}/.config"
function init()
{
_mkdir "${DIR_LOG}"
_mkdir "${DIR_BAK}"
step_setup_file
# daemon_init
install_dot_mngr
# TODO: re-implement SBU with dot_mngr
set_sbu
get_summary
}
# Functions
init
# Main
do_lfs
do_blfs
# Testing Zone
exit ${?}