Skip to content
Snippets Groups Projects
Commit f613e84c authored by František Dvořák's avatar František Dvořák
Browse files

Shell linting

parent 4289fa7a
No related branches found
No related tags found
No related merge requests found
...@@ -24,11 +24,11 @@ echo "Terraform finished. Continue? (CTRL-C to quit)" ...@@ -24,11 +24,11 @@ echo "Terraform finished. Continue? (CTRL-C to quit)"
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/hosts.txt); do while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
done done <terraform/hosts.txt
# check ssh access # check ssh access
ansible -m command -a 'uname -a' allnodes ansible -m command -a 'uname -a' allnodes
......
...@@ -42,7 +42,6 @@ EOF ...@@ -42,7 +42,6 @@ EOF
return 0 return 0
} }
TEMP=$(getopt -o 'i:e:s:q:hn' --long 'include:,exclude:,soft-quota:,hard-quota:,help,dry-run' -n 'xfs-quotas.sh' -- "$@") || exit $? TEMP=$(getopt -o 'i:e:s:q:hn' --long 'include:,exclude:,soft-quota:,hard-quota:,help,dry-run' -n 'xfs-quotas.sh' -- "$@") || exit $?
eval set -- "$TEMP" eval set -- "$TEMP"
unset TEMP unset TEMP
...@@ -106,7 +105,16 @@ mv /tmp/quota.list2 /tmp/quota.list ...@@ -106,7 +105,16 @@ mv /tmp/quota.list2 /tmp/quota.list
cut -d: -f1 /etc/projid 2>/dev/null | sort | uniq >/tmp/quota.xfs.list cut -d: -f1 /etc/projid 2>/dev/null | sort | uniq >/tmp/quota.xfs.list
lastid=0 lastid=0
lastid="$( (maxid=0; IFS=:; while read -r dir id; do if test "$id" -gt "$maxid"; then maxid="$id"; fi; done; echo "$maxid") < /etc/projid )" lastid="$( (
maxid=0
IFS=:
while read -r dir id; do
if test "$id" -gt "$maxid"; then
maxid="$id"
fi
done
echo "$maxid"
) </etc/projid)"
cat <<EOF >/tmp/quota-cmd.sh cat <<EOF >/tmp/quota-cmd.sh
#! /bin/sh -e #! /bin/sh -e
cp -p /etc/projects /etc/projects.new cp -p /etc/projects /etc/projects.new
......
...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to ...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/fip.txt); do while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
done done <terraform/fip.txt
# check ssh access # check ssh access
ansible -m command -a 'uname -a' allnodes ansible -m command -a 'uname -a' allnodes
......
...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to ...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/hosts.txt); do while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
done done <terraform/hosts.txt
# check ssh access # check ssh access
ansible -m command -a 'uname -a' allnodes ansible -m command -a 'uname -a' allnodes
......
...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to ...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/fip.txt); do while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
done done <terraform/fip.txt
# check ssh access # check ssh access
ansible -m command -a 'uname -a' allnodes ansible -m command -a 'uname -a' allnodes
......
...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to ...@@ -24,11 +24,11 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/hosts.txt); do while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
done done <terraform/hosts.txt
# check ssh access # check ssh access
ansible -m command -a 'uname -a' allnodes ansible -m command -a 'uname -a' allnodes
......
...@@ -24,7 +24,7 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to ...@@ -24,7 +24,7 @@ echo "Terraform finished. Check terraform/docker-volume.sh. Continue? (CTRL-C to
read -r _ read -r _
# wait for ping and ssh # wait for ping and ssh
for ip in $(cat terraform/hosts.txt) $(cat terraform/fip.txt); do cat terraform/hosts.txt terraform/fip.txt | while read -r ip; do
while ! ping -c 1 "$ip"; do sleep 5; done while ! ping -c 1 "$ip"; do sleep 5; done
ssh-keygen -R "$ip" ssh-keygen -R "$ip"
while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done while ! ssh egi@"$ip" -o ConnectTimeout=10 -o PreferredAuthentications=publickey -o StrictHostKeyChecking=no :; do sleep 10; done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment