Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56999388
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/roles/paas-docker/systemd-unit/files/get-containers-list.sh b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
index 989dedd..24e84a6 100755
--- a/roles/paas-docker/systemd-unit/files/get-containers-list.sh
+++ b/roles/paas-docker/systemd-unit/files/get-containers-list.sh
@@ -1,55 +1,46 @@
#!/usr/bin/env bash
# -------------------------------------------------------------
# PaaS Docker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-01-30
# License: Trivial work, not eligible to copyright
# Source file: roles/paas-docker/systemd-unit/files/get-containers-list.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
## Read /etc/containers.conf and recover docker’s names into an array.
## get-containers-list [--reverse]
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
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 14, 19:18 (3 d, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4231228
Default Alt Text
(2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment