replace blank line whitespaces from scripts

Change-Id: I16961f1efa5fcaf067ba688e1244c00d22b54a6e
Closes-Bug: 1398930
This commit is contained in:
Jesse Pretorius 2014-12-03 18:45:25 +00:00
parent 3df4548c95
commit 32095707ec
2 changed files with 10 additions and 10 deletions

View File

@ -43,12 +43,12 @@ function successerator() {
RETRY=0
# Set the initial return value to failure
false
while [ $? -ne 0 -a ${RETRY} -lt ${MAX_RETRIES} ];do
RETRY=$((${RETRY}+1))
$@
done
if [ ${RETRY} -eq ${MAX_RETRIES} ];then
echo "Hit maximum number of retries, giving up..."
exit 1
@ -64,8 +64,8 @@ function install_bits() {
if [ ! -d "/opt" ];then
mkdir /opt
fi
if [ ! "$(swapon -s | grep -v Filename)" ];then
cat > /opt/swap.sh <<EOF
#!/usr/bin/env bash
@ -80,24 +80,24 @@ mkswap \${SWAPFILE}
swapon \${SWAPFILE}
fi
EOF
chmod +x /opt/swap.sh
/opt/swap.sh
fi
if [ -f "/opt/swap.sh" ];then
if [ ! -f "/etc/rc.local" ];then
touch /etc/rc.local
fi
if [ "$(grep 'exit 0' /etc/rc.local)" ];then
sed -i '/exit\ 0/ s/^/#\ /' /etc/rc.local
fi
if [ ! "$(grep 'swap.sh' /etc/rc.local)" ];then
echo "/opt/swap.sh" | tee -a /etc/rc.local
fi
chmod +x /etc/rc.local
fi

View File

@ -7,5 +7,5 @@ STRING_MATCH='THIS WILL NEVER MATCH ONLY CHANGE THIS TO A SENSIBLE VALUE'
# NB - use with caution, will remove all alarms/checks for enttities that are matched.
ENTITIES=$(raxmon-entities-list --username $USERNAME --api-key $APIKEY | grep $STRING_MATCH | awk '{print $2}' | cut -d = -f2)
for e in $ENTITIES; do CHECKS=$(raxmon-checks-list --username $USERNAME --api-key $APIKEY --entity-id $e | grep Check | awk '{print $2}' | cut -d = -f 2); for c in $CHECKS; do raxmon-checks-delete --username $USERNAME --api-key $APIKEY --entity-id $e --id $c; done; done