-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctsat
More file actions
75 lines (67 loc) · 1.15 KB
/
Copy pathctsat
File metadata and controls
75 lines (67 loc) · 1.15 KB
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
67
68
69
70
71
72
73
74
75
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Deve executar o comando como super usuario!"
exit 0
fi
case "$1" in
-bg|--background)
if ( ctsat-status | grep -i lnx_ctsat ) >> /dev/null
then
echo -e "Aplicativo CTSAT já está ativo!"
read -t 3
else
nohup ctsat-on >> /dev/null 2>&1 &
read -t 2
if ( ctsat-status | grep -i lnx_ctsat ) >> /dev/null
then
echo -e "Aplicativo CTSAT ativado!"
read -t 3
else
echo -e "Aplicativo CTSAT nao foi ativado!"
read -t 3
fi
fi
exit 0
;;
-on)
if ( ctsat-status | grep -i lnx_ctsat ) >> /dev/null
then
echo -e "Aplicativo CTSAT já está ativo!"
read -t 3
else
SATDIR=/Zanthus/Zeus/ctsat
SATEXEC=./lnx_ctsat.xz
cd $SATDIR
sudo $SATEXEC
fi
exit 0
;;
-off)
kill -9 $(pgrep lnx_ctsat)
exit 0
;;
--restart)
kill -9 $(pgrep lnx_ctsat)
if ( ctsat-status | grep -i lnx_ctsat ) >> /dev/null
then
echo -e "Aplicativo CTSAT já está ativo!"
read -t 3
else
SATDIR=/Zanthus/Zeus/ctsat
SATEXEC=./lnx_ctsat.xz
cd $SATDIR
sudo $SATEXEC
fi
exit 0
;;
--status)
pgrep -l lnx_ctsat
exit 0
;;
*)
echo -e "
Parâmetro inválido...
Use: "$0" {-bg|--background/-on/-off/--restart/--status}
"
;;
esac