Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docs.it4i.cz
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Ciz
docs.it4i.cz
Commits
7121a289
Commit
7121a289
authored
8 years ago
by
Lukáš Krupčík
Browse files
Options
Downloads
Patches
Plain Diff
new version
parent
52a2591c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
skripts/motd.sh
+26
-11
26 additions, 11 deletions
skripts/motd.sh
with
26 additions
and
11 deletions
skripts/motd.sh
+
26
−
11
View file @
7121a289
...
...
@@ -18,13 +18,13 @@ LAST=$(wc -l "$i" | cut -f1 -d' ')
DOWN
=
$((
LAST-END+2
))
sed
'1,'
"
$((
HEAD-1
))
"
'd'
"
$i
"
|
sed
-n
-e
:a
-e
'1,'
"
$DOWN
"
'!{P;N;D;};N;ba'
|
sed
'/<div/d'
>
"TMP.html"
rm
"
$i
"
rm
"
/srv/downtime/
$i
"
title
=
"Message of the day"
head
=
$(
cat
TMP.html |
grep
"rss-item-title"
|
cut
-d
">"
-f
2 |
cut
-d
"<"
-f
1
)
date
=
$(
cat
TMP.html |
grep
"<i>"
|
cut
-d
">"
-f
2 |
cut
-d
"<"
-f
1 |
cut
-d
" "
-f
1
)
info
=
$(
cat
TMP.html |
grep
"<p>"
|
cut
-d
">"
-f
2 |
cut
-d
"<"
-f
1
)
rm
TMP.html
rm
/srv/downtime/
TMP.html
echo
""
echo
"
$title
"
...
...
@@ -34,21 +34,36 @@ echo ""
# poovolene stavy - Salomon Maintenance, Anselm Maintenance, Back in Production, Infrastructure Maintenance, PBS Maintenance, SCRATCH Maintenance, HOME Maintenance, Salomon and Anselm Maintenance
if
[
"
$head
"
=
"Salomon Maintenance"
]
||
[
"
$head
"
=
"Anselm Maintenance"
]
||
[
"
$head
"
=
"Back in Production"
]
||
[
"
$head
"
=
"Infrastructure Maintenance"
]
||
[
"
$head
"
=
"PBS Maintenance"
]
||
[
"
$head
"
=
"SCRATCH Maintenance"
]
||
[
"
$head
"
=
"HOME Maintenance"
]
||
[
"
$head
"
=
"Salomon and Anselm Maintenance"
]
;
then
dateDown
=
$(
cat
downtimes_history.md |
sed
-n
'/---/{n;p;}'
|
cut
-d
"|"
-f
2 |
cut
-d
" "
-f
1
)
headDown
=
$(
cat
downtimes_history.md |
sed
-n
'/---/{n;p;}'
|
cut
-d
"|"
-f
3 |
cut
-d
"*"
-f
3
)
dateDown
=
$(
cat
/srv/downtime/docs/index.md |
sed
-n
'/---/{n;p;}'
|
cut
-d
"|"
-f
2 |
cut
-d
" "
-f
1
)
headDown
=
$(
cat
/srv/downtime/docs/index.md |
sed
-n
'/---/{n;p;}'
|
cut
-d
"|"
-f
3 |
cut
-d
"*"
-f
3
)
echo
"
$date
-
$dateDown
"
if
[
"
$date
"
=
"
$dateDown
"
]
&&
[
"
$head
"
=
"
$headDown
"
]
;
then
echo
"Everything up-to-date..."
else
echo
"Updating Downtime History..."
test
=
" |
$date
|**
$head
**
$info
|"
sed
'/---/a '
"
$test
"
''
downtime
s_history.md
>
TMP.md
cat
TMP.md
>
downtime
s_history
.md
rm
TMP.md
test
=
" |
$date
00:00:00
|**
$head
**
$info
|"
sed
'/---/a '
"
$test
"
''
/srv/
downtime
/docs/index.md
>
/srv/downtime/
TMP.md
cat
/srv/downtime/
TMP.md
>
/srv/
downtime
/docs/index
.md
#
rm
/srv/downtime/
TMP.md
fi
#echo "### $title" > MOTD.md
#echo "**$head**" >> MOTD.md
#echo "$date - $info" >> MOTD.md
# echo "### $title" > docs/index.md
# echo "**$head**" >> docs/index.md
# echo "$date - $info" >> docs/index.md
else
echo
"Downtime History not updated..."
fi
echo
"#
$title
"
>
docs/motd.md
echo
"**
$head
**"
>>
docs/motd.md
echo
"
$date
-
$info
"
>>
docs/motd.md
time
=
$(
date
)
sed
'$d'
/srv/downtime/docs/index.md
>
/srv/downtime/TMP.md
cat
/srv/downtime/TMP.md
>
/srv/downtime/docs/index.md
rm
/srv/downtime/TMP.md
echo
"updating
$time
"
>>
/srv/downtime/docs/index.md
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment