forked from freudenreichan/EinfuehrungInDocker_Pipeline2
deployment.c hinzugefügt
This commit is contained in:
parent
933fcc4779
commit
326c1c68af
48
deployment.c
Normal file
48
deployment.c
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
char *loremIpsum[] = {
|
||||||
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
||||||
|
"Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||||
|
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
||||||
|
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||||
|
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||||
|
"Nunc scelerisque justo vitae neque efficitur consequat.",
|
||||||
|
"Cras sit amet risus ac neque scelerisque hendrerit nec nec nisl.",
|
||||||
|
"Praesent et turpis vel justo ullamcorper consequat.",
|
||||||
|
"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.",
|
||||||
|
"Nullam euismod, tortor et finibus feugiat, enim libero convallis ipsum, et venenatis lectus nulla ac nulla.",
|
||||||
|
"Suspendisse non mauris sed tortor fringilla molestie.",
|
||||||
|
"Phasellus tempor diam quis odio fringilla scelerisque.",
|
||||||
|
"Maecenas id enim a risus varius semper vel sed libero."
|
||||||
|
};
|
||||||
|
|
||||||
|
void printRandomText() {
|
||||||
|
int index = rand() % (sizeof(loremIpsum) / sizeof(loremIpsum[0]));
|
||||||
|
printf("%s\n", loremIpsum[index]);
|
||||||
|
fflush(stdout); // Flush the output to ensure it's immediately visible
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
if (argc != 2) {
|
||||||
|
printf("Usage: %s <interval_seconds>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int interval_seconds = atoi(argv[1]);
|
||||||
|
if (interval_seconds <= 0) {
|
||||||
|
printf("Interval must be a positive integer.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
srand(time(NULL)); // seed the random number generator with current time
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
printRandomText();
|
||||||
|
sleep(interval_seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user