Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove argument, usage and functionality with argument -c cluster #20

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions resources/bin/rb_wakeup_chef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ source /etc/init.d/functions
source /etc/profile

function usage() {
echo "$0 [ -l ] [ -c ] [ -s <service_name> ] [ -i ] [ -n <nodename> ]"
echo "$0 [ -l ] [ -s <service_name> ] [ -i ] [ -n <nodename> ]"
echo " * -l -> show logs after the wakeup"
echo " * -c -> wakeup full cluster"
#echo " * -i -> wakeup sensor nodes"
#echo " * -n <nodename> -> wakeup sensor/manager node name"
echo " * -s <service> -> wakeup manager with this service name enabled"
Expand Down Expand Up @@ -39,30 +38,19 @@ function wakeup_node_service() {
fi
}

wmanagers=0
showlogs=0
service=""

while getopts "hcs:l" name
while getopts "hs:l" name
do
case $name in
h) usage;;
c) wmanagers=1;;
l) showlogs=1;;
s) service="$OPTARG";;
*) usage;;
esac
done

if [ $wmanagers -eq 1 ]; then
if [ "x$service" == "x" ]; then
/usr/bin/serf query -timeout=250ms -no-ack wakeup-chef &>/dev/null
else
# TODO
wakeup_node_service $service &>/dev/null #Only wakeup in local node if the service exists
fi
else
wakeup
fi
wakeup

if [ $showlogs -eq 1 ]; then
echo "Showing chef-client logs on $(hostname): "
Expand Down