-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc.sh
executable file
·56 lines (38 loc) · 1.36 KB
/
bashrc.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
#!/bin/bash
#***************************[check if already sourced]************************
# 2019 12 01
if [ "$SOURCED_BASH_NETWORK" != "" ]; then
return
exit
fi
if [ "$SOURCED_BASH_LAST" == "" ]; then
export SOURCED_BASH_LAST=1
else
export SOURCED_BASH_LAST="$(expr "$SOURCED_BASH_LAST" + 1)"
fi
export SOURCED_BASH_NETWORK="$SOURCED_BASH_LAST"
#***************************[optional external variables]*********************
# 2020 04 07
# NETWORK_PATH_LOG
if [ "$NETWORK_PATH_LOG" != "" ] && [ ! -d "$NETWORK_PATH_LOG" ]; then
echo -n "Error sourcing \"network\": "
echo "path \$NETWORK_PATH_LOG does not exist"
fi
#***************************[paths and files]*********************************
# 2021 03 21
export NETWORK_PATH="$(realpath "$(dirname "${BASH_SOURCE}")" )/"
# load and check data dir
if [ "$NETWORK_PATH_LOG" == "" ]; then
NETWORK_PATH_LOG="$(_repo_bash_data_dirs_get --mkdir "network" \
"${NETWORK_PATH}log/")"
fi
if type -t _repo_bash_data_dirs_check >> /dev/null; then
_repo_bash_data_dirs_check --rmdir "$NETWORK_PATH_LOG" \
"network" "${NETWORK_PATH}log/"
fi
#***************************[source]******************************************
# 2021 03 24
source "${NETWORK_PATH}scripts/files.sh"
source "${NETWORK_PATH}scripts/ssh.sh"
source "${NETWORK_PATH}scripts/ping.sh"
source "${NETWORK_PATH}scripts/help.sh"