Page MenuHomeDevCentral

D1049.diff
No OneTemporary

D1049.diff

diff --git a/roles/paas-docker/systemd-unit/files/get-containers-list.sh b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
--- a/roles/paas-docker/systemd-unit/files/get-containers-list.sh
+++ b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
@@ -21,35 +21,26 @@
file='/etc/containers.conf'
-if [[ ! -f "$file" ]]; then
-
- echo "$file : does not exists "
- exit 1
-elif [[ ! -r "$file" ]]; then
-
- echo "$file : can not read "
+if [[ ! -f "$file" ]]; then
+ echo "$file : does not exists "
+ exit 1
+elif [[ ! -r "$file" ]]; then
+ echo "$file : can not read "
fi
-#Get names in an array
+# Get names in an array
# 21:42 <geirha> since bash 4, you can use mapfile instead of that while read loop. mapfile -t array < "$file"
-
mapfile -t array < "$file"
-#Test argument to know in wich order return names
+# Test argument to know in wich order return names
if [[ $1 == "--reverse" ]]; then
- for ((i="${#array[*]}"; i > 0; i--)) ; do
-
- echo "${array[i]}"
- done
-
-elif [[ -z "$1" ]] ; then
- for ((i=0; i < "${#array[*]}"; i++)) ; do
-
- echo "${array[i]}"
- done
-
+ for ((i="${#array[*]}"; i > 0; i--)); do
+ echo "${array[i]}"
+ done
+elif [[ -z "$1" ]]; then
+ for ((i=0; i < "${#array[*]}"; i++)); do
+ echo "${array[i]}"
+ done
else
- echo "$1 is not a valid argument"
+ echo "$1 is not a valid argument"
fi
-
-

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 8, 02:14 (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2181250
Default Alt Text
D1049.diff (1 KB)

Event Timeline