This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
4 changed files with
21 additions and
7 deletions
|
|
@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
name: Lint Shell Scripts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
|
|
|
push:
|
|
|
|
|
|
|
|
branches:
|
|
|
|
|
|
|
|
- main
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
shellcheck:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: ludeeus/action-shellcheck@1.1.0
|
|
|
@ -26,8 +26,8 @@ if test -f "$1"; then
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Incorrect skylink at line ${line_number}: $line" && exit 1
|
|
|
|
echo "Incorrect skylink at line ${line_number}: $line" && exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
let line_number+=1
|
|
|
|
(( line_number++ ))
|
|
|
|
done < $1;
|
|
|
|
done < "$1";
|
|
|
|
else
|
|
|
|
else
|
|
|
|
skylinks=("$1") # just single skylink passed as input argument
|
|
|
|
skylinks=("$1") # just single skylink passed as input argument
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
@ -20,7 +20,7 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
countdown() {
|
|
|
|
countdown() {
|
|
|
|
local secs=$1
|
|
|
|
local secs=$1
|
|
|
|
while [ $secs -gt 0 ]; do
|
|
|
|
while [ "$secs" -gt 0 ]; do
|
|
|
|
echo -ne "Waiting $secs\033[0K\r"
|
|
|
|
echo -ne "Waiting $secs\033[0K\r"
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
: $((secs--))
|
|
|
|
: $((secs--))
|
|
|
@ -28,10 +28,10 @@ countdown() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# delay disabling the portal
|
|
|
|
# delay disabling the portal
|
|
|
|
countdown $delay
|
|
|
|
countdown "$delay"
|
|
|
|
|
|
|
|
|
|
|
|
# stop health-check so the server is taken our of load balancer
|
|
|
|
# stop health-check so the server is taken our of load balancer
|
|
|
|
docker exec health-check cli disable $reason
|
|
|
|
docker exec health-check cli disable "$reason"
|
|
|
|
|
|
|
|
|
|
|
|
# then wait 5 minutes for the load balancer to propagate the dns records
|
|
|
|
# then wait 5 minutes for the load balancer to propagate the dns records
|
|
|
|
countdown $timeout
|
|
|
|
countdown "$timeout"
|
|
|
|
|
|
@ -33,7 +33,7 @@ fi
|
|
|
|
# Write the output in an infinite loop.
|
|
|
|
# Write the output in an infinite loop.
|
|
|
|
while true; do
|
|
|
|
while true; do
|
|
|
|
# CPU usage
|
|
|
|
# CPU usage
|
|
|
|
cpu=$(echo $[100-$(vmstat 1 2|tail -1|awk '{print $15}')])
|
|
|
|
cpu=$((100-$(vmstat 1 2|tail -1|awk '{print $15}')))
|
|
|
|
sed -i "1iCPU: ${cpu}" $logfile
|
|
|
|
sed -i "1iCPU: ${cpu}" $logfile
|
|
|
|
|
|
|
|
|
|
|
|
# Disk Usage
|
|
|
|
# Disk Usage
|
|
|
|