#!/bin/bash
#
# Copyright (c) 2019-2020 Oracle and/or its affiliates. All rights reserved.
# Licensed under the GNU General Public License Version 2 as shown at https://oss.oracle.com/licenses/GPL-2.

whitelist="crio
kubelet
"

set -e

if echo "$whitelist" | grep -q -x "$1" ; then
        systemctl restart "$1"
	exit 0
fi

echo "systemctl restart cannot be run for $1 service"
exit 1
