-
Notifications
You must be signed in to change notification settings - Fork 0
/
kurzitrc
executable file
·66 lines (58 loc) · 1.47 KB
/
kurzitrc
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
#!/usr/bin/env bash
# Load Appropriate Alias Scripts based on $DIST
function Load_Aliases () {
# Distro Specific
for fn in $(find $kurzit_home/aliases/ -name "*.$DIST"); do
. $fn
done
# General Bash Aliases
for fn in $(find $kurzit_home/aliases/ -name "*.Bash"); do
. $fn
done
}
# Load Utilities
function Load_Utilities () {
# General Bash Aliases
for fn in $(find $kurzit_home/utils/ -type f ); do
. $fn
done
}
# Load Custom
function Load_Custom () {
if [ -e $kurzit_home/custom.sh ]; then
. $kurzit_home/custom.sh
fi
}
# Unalias existing Aliases
function Alias_Check () {
_alias=${1}
if [[ $(type -t $_alias) == "alias" ]]; then
unalias $_alias
fi
}
# Unload existing Function
function Function_Check () {
_function=${1}
if [[ $(type -t $_function) == "function" ]]; then
unset -f $_function
fi
}
# Parse Date of Last Update
function Last_Update_Check () {
#_kurzit_last_update=$(cat ~/.kdup)
_kurzit_last_update=$(eval "$(which cat) ~/.kdup")
if [ -z $_kurzit_last_update ]; then
echo "Cannot find Last Update, running update script..."
$kurzit_home/update
else
if [ $(( ( $(date +%s) - _kurzit_last_update )/(60*60*24) )) -ge "14" ]; then
echo "Checking for Latest Kurzit Update, running update script..."
$kurzit_home/update
fi
fi
}
# Main Script
Last_Update_Check
Load_Aliases
Load_Utilities
Load_Custom