-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglc.sh
67 lines (49 loc) · 1.76 KB
/
glc.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
#!/bin/sh
##########################################################################
# Yet Another Monitor (YAMon)
# Copyright (c) 2013-present Al Caughey
# All rights reserved.
#
# get a local copy of the JS & CSS files hosted at usage-monitoring.com
#
##########################################################################
d_baseDir=$(cd "$(dirname "$0")" && pwd)
delay=$1
[ -z "$delay" ] && delay=5
source "$d_baseDir/config.file"
source "${d_baseDir}/includes/versions.sh"
source "$d_baseDir/includes/util$_version.sh"
source "${d_baseDir}/includes/defaults.sh"
source "${d_baseDir}/strings/$_lang/strings.sh"
source "$d_baseDir/includes/getLocalCopies.sh"
clear
echo -E "$_s_title"
echo "
******************************************************************
This script will get a local copy of the JS & CSS files hosted
at usage-monitoring.com
******************************************************************
"
[ ! -f "${d_baseDir}/config.file" ] && [ ! -f "${d_baseDir}/default_config.file" ] && echo '*** Cannot find either config.file or default config.file...
*** Please check your installation! ***
*** Exiting the script. ***' && exit 0
_configFile="${d_baseDir}/config.file"
[ ! -f "$_configFile" ] && _configFile="${d_baseDir}/default_config.file"
source "$_configFile"
loadconfig()
sleep $delay
if [ "${_logDir:0:1}" == "/" ] ; then
_logfilename="${_logDir}/glc.log"
else
_logfilename="${d_baseDir}/${_logDir}/glc.log"
fi
_logfilename=${_logfilename//\/\//\/}
echo "Log info will be written to $_logfilename"
[ ! -f "$_logfilename" ] && touch "$_logfilename"
$send2log "Log file: \`$_logfilename\`" 1
$send2log "Loading baseline settings from \`$_configFile\`." 2
sleep $delay
getLocalCopies
echo "
Done! Local copies of the files have been updated.
"