You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DEFAULT_GITHUB_OWNER="BradleyA"# Required for this script to work. Either as the first argument on the command line or defined as GITHUB_OWNER environment variable or hard coded here #34
47
45
48
46
### Production standard 8.3.541 --usage
@@ -72,7 +70,7 @@ echo "<GITHUB_OWNER> can be the first argument on the command line or defined
72
70
echo"GITHUB_OWNER environment variable."
73
71
echo -e "\nData storage is required for this solution, so you need to have permission"
74
72
echo"to create /usr/local/data/github for short and long term storage. To use"
75
-
echo"a different directory export GITHUB_DATA_DIR environment variable."
73
+
echo"a different directory export GITHUB_TRAFFIC_DIR environment variable."
76
74
echo -e "\nIn the future, this printed crontab list will be appended to a crontab file."
77
75
echo"The crontab command normally only manages a single crontab per user. Need a"
78
76
echo"method for multiple SRE team members to manage one crontab."
@@ -108,8 +106,8 @@ echo " setting 4 and exit if any command in a pipeline erro
108
106
echo" more information about the set options, see man bash."# 3.550
109
107
#
110
108
echo" GITHUB_OWNER Github repository account name (default ${DEFAULT_GITHUB_OWNER})"#34
111
-
echo"GITHUB_DATA_DIR GitHub long term traffic solution directory"
112
-
echo" (default ${DEFAULT_GITHUB_DATA_DIR})"
109
+
echo"GITHUB_TRAFFIC_DIR GitHub long term traffic solution directory"
if [[ "${DEBUG}"=="1" ]] ;then new_message "${LINENO}""DEBUG"" Variable... GITHUB_OWNER >${GITHUB_OWNER}<"1>&2;fi
223
221
# Order of precedence: environment variable, default code
224
-
if [[ "${GITHUB_DATA_DIR}"=="" ]] ;thenGITHUB_DATA_DIR=${DEFAULT_GITHUB_DATA_DIR};fi
225
-
if [[ "${DEBUG}"=="1" ]] ;then new_message "${LINENO}""DEBUG"" Variable... GITHUB_DATA_DIR >${GITHUB_DATA_DIR}<"1>&2;fi
222
+
if [[ "${GITHUB_TRAFFIC_DIR}"=="" ]] ;thenGITHUB_TRAFFIC_DIR=${DEFAULT_GITHUB_TRAFFIC_DIR};fi
223
+
if [[ "${DEBUG}"=="1" ]] ;then new_message "${LINENO}""DEBUG"" Variable... GITHUB_TRAFFIC_DIR >${GITHUB_TRAFFIC_DIR}<"1>&2;fi
226
224
227
225
# Create log directory for crontab ${GITHUB_OWNER} jobs
228
-
mkdir -p "${GITHUB_DATA_DIR}/${GITHUB_OWNER}/log"|| { new_message "${LINENO}""${RED}ERROR${WHITE}""${GITHUB_DATA_DIR}/${GITHUB_OWNER} was not created maybe permission incident."1>&2;exit 1; }
226
+
mkdir -p "${GITHUB_TRAFFIC_DIR}/${GITHUB_OWNER}/log"|| { new_message "${LINENO}""${RED}ERROR${WHITE}""${GITHUB_TRAFFIC_DIR}/${GITHUB_OWNER} was not created maybe permission incident."1>&2;exit 1; }
229
227
230
228
# Check if github.repository.list file size>0 and the file is readable
231
229
if [[ !-s"github.repository.list" ]] && [[ -r"github.repository.list" ]] ;then
232
230
new_message "${LINENO}""${RED}ERROR${WHITE}"" github.repository.list file does not exist in directory or is not size>0 or is not readable. github.repository.list file should include Github owner's repository names, one per line."1>&2
0 commit comments