Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CIP-Admins
cip-foxtemp
Commits
7c19055b
Commit
7c19055b
authored
Aug 02, 2017
by
Johannes Schilling
Browse files
cip-grafana-tempgraph-extract: refactor
parent
505fa707
Changes
1
Hide whitespace changes
Inline
Side-by-side
cip-grafana-tempgraph-extract
View file @
7c19055b
...
...
@@ -3,13 +3,18 @@
set
-eu
CURDATE
=
$(
date
+%s
)
OUTDIR
=
/var/www/temperature
url
()
{
olddate
=
$(
date
--date
=
"
$1
"
+%s
)
printf
"http://localhost:3621/render/dashboard-solo/db/public-temperature?orgId=1&from=%d000&to=%d000&panelId=1&width=1000&height=500&theme=light"
"
${
olddate
}
"
"
${
CURDATE
}
"
}
/usr/bin/curl
-H
'X-Remote-User: nobody'
"
$(
url
'24 hours ago'
)
"
>
/var/www/temperature/day.png
/usr/bin/curl
-H
'X-Remote-User: nobody'
"
$(
url
'7 days ago'
)
"
>
/var/www/temperature/week.png
/usr/bin/curl
-H
'X-Remote-User: nobody'
"
$(
url
'30 days ago'
)
"
>
/var/www/temperature/month.png
/usr/bin/curl
-H
'X-Remote-User: nobody'
"
$(
url
'360 days ago'
)
"
>
/var/www/temperature/year.png
fetch
()
{
/usr/bin/curl
-H
'X-Remote-User: nobody'
"
$(
url
"
$1
"
)
"
>
"
${
OUTDIR
}
/
${
2
}
.png"
}
fetch
"24 hours ago"
day
fetch
"7 days ago"
week
fetch
"30 days ago"
month
fetch
"360 days ago"
year
Write
Preview
Supports
Markdown
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