2020-01-26 15:56:42 -06:00
|
|
|
#!/bin/bash
|
|
|
|
# This script is invoked by topology.service only
|
|
|
|
# for multi-asic virtual platform. For multi-asic platform
|
|
|
|
# multiple Database instances are present
|
|
|
|
# and HWKSU information is retrieved from first database instance.
|
|
|
|
#
|
|
|
|
|
|
|
|
start() {
|
2020-04-03 16:34:38 -05:00
|
|
|
DB_FIRST_INSTANCE="/var/run/redis0/redis.sock"
|
|
|
|
TOPOLOGY_SCRIPT="topology.sh"
|
|
|
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform -s $DB_FIRST_INSTANCE`
|
|
|
|
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]' -s $DB_FIRST_INSTANCE`
|
|
|
|
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT start
|
2020-01-26 15:56:42 -06:00
|
|
|
}
|
|
|
|
stop() {
|
2020-04-03 16:34:38 -05:00
|
|
|
DB_FIRST_INSTANCE="/var/run/redis0/redis.sock"
|
|
|
|
TOPOLOGY_SCRIPT="topology.sh"
|
|
|
|
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform -s $DB_FIRST_INSTANCE`
|
|
|
|
HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]' -s $DB_FIRST_INSTANCE`
|
|
|
|
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT stop
|
2020-01-26 15:56:42 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start|stop)
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop}"
|
|
|
|
;;
|
|
|
|
esac
|