Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
le6
create-iso
Commits
b3a46582
Commit
b3a46582
authored
Oct 02, 2018
by
sulzbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding features to run create-iso as a cron job
parent
0428e85e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
2 deletions
+32
-2
conf/opts.conf
conf/opts.conf
+1
-0
create-iso.sh
create-iso.sh
+4
-1
cronjob.sh
cronjob.sh
+18
-0
helper/logging.incsh
helper/logging.incsh
+5
-0
mail.txt
mail.txt
+3
-0
src/lc6/preseed.cfg
src/lc6/preseed.cfg
+1
-1
No files found.
conf/opts.conf
View file @
b3a46582
...
...
@@ -5,3 +5,4 @@ _OUTPUT=""
_
REPO
=
"stable"
_
VERSION
=
""
_
DEBUG
=
false
_
MAIL
=
false
create-iso.sh
View file @
b3a46582
...
...
@@ -33,6 +33,7 @@ while true; do
-o
|
--output
)
_OUTPUT
=
"
$2
"
;
shift
;
shift
;;
-r
|
--repo
)
_REPO
=
"
$2
"
;
shift
;
shift
;;
-d
|
--debug
)
_DEBUG
=
true
;
shift
;;
-s
|
--sendmail
)
_MAIL
=
true
;
shift
;;
-
*
)
echo
"Unrecognized option. Try with --help."
;
\
exit
1
;;
*
)
break
;;
...
...
@@ -96,7 +97,9 @@ if [ "${_REPO}" != "stable" ] && [ "${_REPO}" != "testing" ] && \
exit
1
fi
TIME_STAMP
=
"
$(
date
+
'%Y-%m-%dT%H:%M:%S'
)
"
export
_MAIL
export
TIME_STAMP
=
"
$(
date
+
'%Y-%m-%dT%H:%M:%S'
)
"
export
LOG_FILE
=
"
${
LOG_PATH
}
/create-iso-
${
TIME_STAMP
}
.log"
...
...
cronjob.sh
0 → 100755
View file @
b3a46582
#!/bin/bash
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
"You must have more power to run this script. Are you root?"
exit
-1
fi
SESSION
=
"
$(
date
+
'%Y-%m-%d'
)
"
DIR
=
"/home/lucas/create-iso"
CMD
=
"./create-iso.sh --profile le6 --version 6.1.1 --repo testing --debug --sendmail"
# Create GNU screen session
screen
-dmS
"
${
SESSION
}
"
||
exit
1
# Execute c3geniso in the main window
screen
-S
"
${
SESSION
}
"
-X
stuff
"pushd
${
DIR
}
&&
${
CMD
}
&& exit
\n
"
||
exit
2
exit
0
helper/logging.incsh
View file @
b3a46582
...
...
@@ -54,6 +54,11 @@ createIsoLogger() {
echo -e "${LOG_LINE}" >> "${LOG_FILE}"
if [ "${TYPE}" -eq "${ERROR}" ] || [ "${TYPE}" -eq "${DEBUG}" ]; then
[[ "${_MAIL}" == true ]] && sendmail -t <<< \
"$(sed "s/##SUBJECT##/${TIME_STAMP}/" < \
"${PREFIX}/mail.txt" && screen -ls; echo ""; \
tail --lines=20 "${LOG_FILE}")" || createIsoLogger -m \
"Unable to send mail"
/bin/bash
fi
else
...
...
mail.txt
0 → 100644
View file @
b3a46582
To: ls17@c3sl.ufpr.br
Subject: ##SUBJECT##
src/lc6/preseed.cfg
View file @
b3a46582
...
...
@@ -14,7 +14,7 @@ ubiquity ubiquity/success_command \
in-target apt-cdrom add --fast --no-mount </dev/null; \
in-target apt-get update --yes; \
in-target apt-get install --yes lc-conf; \
if grep -qi "
S
erver" "/etc/default/version"; then \
if grep -qi "
s
erver" "/etc/default/version"; then \
in-target env DEBIAN_FRONTEND=noninteractive apt-get install --yes -o \
Dpkg::Options::="--force-confnew" lc-server-all; \
else \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment