replace blank line whitespaces from scripts
Change-Id: I16961f1efa5fcaf067ba688e1244c00d22b54a6e Closes-Bug: 1398930
This commit is contained in:
parent
3df4548c95
commit
32095707ec
@ -43,12 +43,12 @@ function successerator() {
|
|||||||
RETRY=0
|
RETRY=0
|
||||||
# Set the initial return value to failure
|
# Set the initial return value to failure
|
||||||
false
|
false
|
||||||
|
|
||||||
while [ $? -ne 0 -a ${RETRY} -lt ${MAX_RETRIES} ];do
|
while [ $? -ne 0 -a ${RETRY} -lt ${MAX_RETRIES} ];do
|
||||||
RETRY=$((${RETRY}+1))
|
RETRY=$((${RETRY}+1))
|
||||||
$@
|
$@
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ${RETRY} -eq ${MAX_RETRIES} ];then
|
if [ ${RETRY} -eq ${MAX_RETRIES} ];then
|
||||||
echo "Hit maximum number of retries, giving up..."
|
echo "Hit maximum number of retries, giving up..."
|
||||||
exit 1
|
exit 1
|
||||||
@ -64,8 +64,8 @@ function install_bits() {
|
|||||||
if [ ! -d "/opt" ];then
|
if [ ! -d "/opt" ];then
|
||||||
mkdir /opt
|
mkdir /opt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! "$(swapon -s | grep -v Filename)" ];then
|
if [ ! "$(swapon -s | grep -v Filename)" ];then
|
||||||
cat > /opt/swap.sh <<EOF
|
cat > /opt/swap.sh <<EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@ -80,24 +80,24 @@ mkswap \${SWAPFILE}
|
|||||||
swapon \${SWAPFILE}
|
swapon \${SWAPFILE}
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x /opt/swap.sh
|
chmod +x /opt/swap.sh
|
||||||
/opt/swap.sh
|
/opt/swap.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/opt/swap.sh" ];then
|
if [ -f "/opt/swap.sh" ];then
|
||||||
if [ ! -f "/etc/rc.local" ];then
|
if [ ! -f "/etc/rc.local" ];then
|
||||||
touch /etc/rc.local
|
touch /etc/rc.local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(grep 'exit 0' /etc/rc.local)" ];then
|
if [ "$(grep 'exit 0' /etc/rc.local)" ];then
|
||||||
sed -i '/exit\ 0/ s/^/#\ /' /etc/rc.local
|
sed -i '/exit\ 0/ s/^/#\ /' /etc/rc.local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$(grep 'swap.sh' /etc/rc.local)" ];then
|
if [ ! "$(grep 'swap.sh' /etc/rc.local)" ];then
|
||||||
echo "/opt/swap.sh" | tee -a /etc/rc.local
|
echo "/opt/swap.sh" | tee -a /etc/rc.local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod +x /etc/rc.local
|
chmod +x /etc/rc.local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -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.
|
# 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)
|
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
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user