Skip to content

Commit

Permalink
Merge pull request xapi-project#5494 from psafont/sweep
Browse files Browse the repository at this point in the history
shellscripts: fix the worse complaints from shellcheck
  • Loading branch information
robhoes authored Mar 11, 2024
2 parents 4ca7a93 + dc3b6d4 commit 4e0d37c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 48 deletions.
2 changes: 2 additions & 0 deletions ocaml/libs/http-lib/client_server_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -eux

trap 'kill $(jobs -p)' EXIT
Expand Down
34 changes: 0 additions & 34 deletions ocaml/message-switch/.coverage.sh

This file was deleted.

9 changes: 5 additions & 4 deletions ocaml/sdk-gen/windows-line-endings.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/bash
#
# Copyright (c) Cloud Software Group, Inc.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#
# 1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
#
# 2) Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Expand Down
6 changes: 3 additions & 3 deletions ocaml/xenopsd/scripts/vif-real
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ handle_promiscuous()
if [ $? -eq 0 -a -n "${arg}" ] ; then
case $NETWORK_MODE in
bridge)
case "${arg}" in
case "${arg}" in
true|on) echo 1 > /sys/class/net/${dev}/brport/promisc ;;
*) echo 0 > /sys/class/net/${dev}/brport/promisc ;;
esac
Expand Down Expand Up @@ -198,7 +198,7 @@ PRIVATE=/xapi/${DOMUUID}/private/vif/${DEVID}
HOTPLUG_STATUS="${XENBUS_PATH}/hotplug-status"
HOTPLUG_ERROR="${XENBUS_PATH}/hotplug-error"

NETWORK_MODE=bridge
NETWORK_MODE=bridge
if [ -e /sys/module/openvswitch ]; then
NETWORK_MODE=openvswitch
fi
Expand All @@ -221,7 +221,7 @@ if [ -n "${UDEV_CALL}" ] && \
exit 0
fi

logger -t scripts-vif "Called as \"$@\" domid:$DOMID devid:$DEVID mode:$NETWORK_MODE"
logger -t scripts-vif "Called as \"$*\" domid:$DOMID devid:$DEVID mode:$NETWORK_MODE"
case "${ACTION}" in
online)
if [ "${TYPE}" = "vif" ] ; then
Expand Down
10 changes: 5 additions & 5 deletions scripts/install-sdk-pool
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ echo "* starting VMS"
echo " starting: template ${VMTEMPLATE}"
${XE} vm-start uuid=${VMTEMPLATE}

for vm in ${vms[@]}
for vm in "${vms[@]}"
do
VM=${vms[$i]}
echo " starting: $vm"
Expand All @@ -69,11 +69,11 @@ ${XEBIN} -s ${masterip} -p ${port} -u root -pw "xensource" ${NOSSL} \
host-license-add license-file="${license}"

# get all ips and update a license to it
for vm in ${vms[@]}
for vm in "${vms[@]}"
do
ip=`${XE} vm-param-get --minimal uuid="${vm}" param-name=networks | awk '{print $2}'`
echo " Applying license to ${vm} at IP (${ip})"

${XEBIN} -s ${ip} -p ${port} -u root -pw "xensource" ${NOSSL} \
host-license-add license-file="${license}"
done
Expand All @@ -82,13 +82,13 @@ sleep 40

echo "* Pooling all VMs to $masterip"

for vm in ${vms[@]}
for vm in "${vms[@]}"
do
ip=`${XE} vm-param-get --minimal uuid="${vm}" param-name=networks | awk '{print $2}'`
echo " Pooling slave VM ${vm} to (${masterip})"

${XEBIN} -s ${ip} -p ${port} -u root -pw "xensource" ${NOSSL} \
pool-join master-address=${masterip} \
master-username=root master-password=xensource master
master-username=root master-password=xensource master

done
2 changes: 1 addition & 1 deletion scripts/test-ha-sr2
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ echo -n "Waiting for Survival Rule 1: "
wait_for_sr 1
echo OK

while [ /bin/true ]; do
while true; do
# Block statefile everywhere
remote_exec_all "iptables -I OUTPUT -p tcp --dport 3260 -j DROP"

Expand Down
2 changes: 1 addition & 1 deletion scripts/xe-install-supplemental-pack
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

die()
{
echo $@ >&2
echo "$@" >&2
exit 1
}

Expand Down

0 comments on commit 4e0d37c

Please sign in to comment.