@@ -113,7 +113,7 @@ initalize_configdb()
113
113
IP_NETNS_CMD=${IP_NETNS_CMD_PREFIX}${NAMESPACE_PREFIX} $2
114
114
fi
115
115
116
- if [ " $1 " == " init" ]; then
116
+ if [[ " $1 " == " init" ] ]; then
117
117
# case when config db need to be created/initialized from minigraph
118
118
sonic-db-cli ${NAMESPACE_ARGUMENT} CONFIG_DB FLUSHDB
119
119
sonic-cfggen -H -m -j ${INIT_CFG_JSON} ${NAMESPACE_ARGUMENT} --write-to-db
@@ -125,7 +125,7 @@ initalize_configdb()
125
125
# this will be run only in per-asic namespace only in multi-npu platforms
126
126
${IP_NETNS_CMD} config qos reload
127
127
${IP_NETNS_CMD} pfcwd start_default
128
- elif [ " $1 " == " reload" ]; then
128
+ elif [[ " $1 " == " reload" ] ]; then
129
129
# case when config db is already present from previous image file system
130
130
sonic-cfggen ${NAMESPACE_ARGUMENT} -j ${CONFIG_DB_PATH}${CONFIG_DB_PREFIX} $2 ${CONFIG_DB_SUFFIX} --write-to-db
131
131
fi
@@ -135,19 +135,18 @@ initalize_configdb()
135
135
configdb_migrator ()
136
136
{
137
137
NAMESPACE_ARGUMENT=' '
138
- IP_NETNS_CMD=' '
139
138
# Create correct argument based on per-asic name space in multi-npu platforms
140
139
if [[ $# -eq 2 ]]; then
141
140
NAMESPACE_ARGUMENT=${NAMESPACE_OPTION}${NAMESPACE_PREFIX} $2
142
141
fi
143
142
144
- if [ " $1 " == " init" ]; then
143
+ if [[ " $1 " == " init" ] ]; then
145
144
# case when config db created/initialized from minigraph need to be migrated
146
145
if [[ -x /usr/bin/db_migrator.py ]]; then
147
146
# Set latest version number
148
147
/usr/bin/db_migrator.py ${NAMESPACE_ARGUMENT} -o set_version
149
148
fi
150
- elif [ " $1 " == " reload" ]; then
149
+ elif [[ " $1 " == " reload" ] ]; then
151
150
# case when config db is already present from previous image file system
152
151
# need to be migrated
153
152
if [[ -x /usr/bin/db_migrator.py ]]; then
@@ -174,7 +173,7 @@ reload_minigraph()
174
173
initalize_configdb init $asic_num
175
174
(( asic_num = asic_num + 1 ))
176
175
done
177
- if [ -f /etc/sonic/acl.json ]; then
176
+ if [[ -f /etc/sonic/acl.json ] ]; then
178
177
# For acl the acl-loader command takes care for multi-npu platforms
179
178
acl-loader update full /etc/sonic/acl.json
180
179
fi
@@ -506,7 +505,7 @@ boot_config()
506
505
PLATFORM=` sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
507
506
# Parse the device specific asic conf file, if it exists
508
507
ASIC_CONF=/usr/share/sonic/device/$PLATFORM /asic.conf
509
- if [ -f " $ASIC_CONF " ]; then
508
+ if [[ -f " $ASIC_CONF " ] ]; then
510
509
source $ASIC_CONF
511
510
fi
512
511
0 commit comments