forked from algorand/go-algorand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsysctl-all.sh
executable file
·44 lines (38 loc) · 936 Bytes
/
sysctl-all.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
#!/usr/bin/env bash
set -e
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
ACTION=""
while [ "$1" != "" ]; do
NEWACTION=""
case "$1" in
-enable)
NEWACTION=enable
;;
-disable)
NEWACTION=disable
;;
-start)
NEWACTION=start
;;
-stop)
NEWACTION=stop
;;
*)
echo "Unknown option" "$1"
exit 1
;;
esac
shift
if [ -n "${NEWACTION}" ]; then
if [ -n "${ACTION}" ]; then
echo "Only one systemctl action can be specified (${ACTION} and ${NEWACTION} found)"
exit 1
fi
ACTION="${NEWACTION}"
fi
done
if [ -z "${ACTION}" ]; then
echo "Please specify a systemctl action (-enable, -disable, -start, or -stop)"
exit 1
fi
${SCRIPTPATH}/sysctl.sh -${ACTION} $(${SCRIPTPATH}/find-nodes.sh ${SCRIPTPATH}/data)