|
1 | | -#!/bin/bash |
2 | | -# Copyright (c) 2021, Oracle and/or its affiliates. |
3 | | -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. |
4 | | - |
5 | | -# Verify the service using systemctl status |
6 | | -function verifyServiceStatus() |
7 | | -{ |
8 | | - serviceName=$1 |
9 | | - systemctl status $serviceName | grep "active (running)" |
10 | | - if [[ $? != 0 ]]; then |
11 | | - echo "$serviceName is not in active (running) state" |
12 | | - exit 1 |
13 | | - fi |
14 | | - echo "$serviceName is active (running)" |
15 | | -} |
16 | | - |
17 | | -#Verify the service using systemctl is-active |
18 | | -function verifyServiceActive() |
19 | | -{ |
20 | | - serviceName=$1 |
21 | | - state=$(systemctl is-active $serviceName) |
22 | | - if [[ $state == "active" ]]; then |
23 | | - echo "$serviceName is active" |
24 | | - else |
25 | | - echo "$serviceName is not active" |
26 | | - exit 1 |
27 | | - fi |
28 | | -} |
29 | | - |
30 | | -echo "Testing on admin server" |
31 | | -servicesList="rngd wls_admin" |
32 | | - |
33 | | -for service in $servicesList |
34 | | -do |
35 | | - verifyServiceStatus $service |
36 | | - verifyServiceActive $service |
37 | | -done |
38 | | - |
39 | | -exit 0 |
| 1 | +#!/bin/bash |
| 2 | +# Copyright (c) 2021, Oracle and/or its affiliates. |
| 3 | +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. |
| 4 | + |
| 5 | +# Verify the service using systemctl status |
| 6 | +function verifyServiceStatus() |
| 7 | +{ |
| 8 | + serviceName=$1 |
| 9 | + systemctl status $serviceName | grep "active (running)" |
| 10 | + if [[ $? != 0 ]]; then |
| 11 | + echo "$serviceName is not in active (running) state" |
| 12 | + exit 1 |
| 13 | + fi |
| 14 | + echo "$serviceName is active (running)" |
| 15 | +} |
| 16 | + |
| 17 | +#Verify the service using systemctl is-active |
| 18 | +function verifyServiceActive() |
| 19 | +{ |
| 20 | + serviceName=$1 |
| 21 | + state=$(systemctl is-active $serviceName) |
| 22 | + if [[ $state == "active" ]]; then |
| 23 | + echo "$serviceName is active" |
| 24 | + else |
| 25 | + echo "$serviceName is not active" |
| 26 | + exit 1 |
| 27 | + fi |
| 28 | +} |
| 29 | + |
| 30 | +echo "Testing on admin server" |
| 31 | +servicesList="rngd wls_admin" |
| 32 | + |
| 33 | +for service in $servicesList |
| 34 | +do |
| 35 | + verifyServiceStatus $service |
| 36 | + verifyServiceActive $service |
| 37 | +done |
| 38 | + |
| 39 | +exit 0 |
0 commit comments