36 lines
768 B
C
36 lines
768 B
C
// deployer main programm
|
|
// Copyright (C) 2024 Jean-Cloud
|
|
// GNU General Public License v3
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
int DEPLOY=false;
|
|
int REMOVE=false;
|
|
|
|
void help()
|
|
{
|
|
printf("usage: ./deployer action file \n with action=deploy or remove and file=path to a file or all. \n");
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
if (argc != 3){
|
|
printf("Invalid number of arguments. \n");
|
|
help();
|
|
exit(1);
|
|
} else {
|
|
if (strcmp(argv[1], "deploy")==0){
|
|
DEPLOY=true;
|
|
} else if (strcmp(argv[1], "remove")==0){
|
|
REMOVE=true;
|
|
} else {
|
|
printf("Invalid argument. \n");
|
|
exit(1);
|
|
}
|
|
}
|
|
return 0;
|
|
} |