-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.sh
executable file
·67 lines (63 loc) · 1.06 KB
/
Main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#!/usr/bin/env/bash
checkIFLogsAreActive(){
if [[ -f "LOGS.txt" ]];
then
echo "there is another process in background"
exit 0
fi
}
help()
{
cat help.txt
}
info()
{
echo '3.14 COPYRIGHT: PATRYK KIRSZENSTEIN '
}
usage()
{
echo "You need to use create or read. For more info use -h "
}
_main() {
IFS=','
for arg in "$@"
do
case "$arg" in
'-h' | '--help')
help
exit 0
;;
'-v' | '--version')
displayInfo
exit 0
;;
esac
done
case "$1" in
'read')
shift
source "Read/Read.sh" $@
exit 0
;;
'create')
shift
source "Create/Create.sh" $@
;;
'cron')
shift
echo "Wpisz to do konsoli aby dodac taski do crona"
echo "(crontab -l 2>/dev/null; echo "* * * * * /home/death/Bash/Controlix") | crontab -"
echo "taski przypisane do crona "
;;
* )
usage
./logsCreator.sh -r
exit 1
esac
}
checkIFLogsAreActive
_main "$@"
./logsCreator.sh -c
./logsCreator.sh -r
exit 0