Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/reboot
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#! /bin/bash

# Check root privileges
if [[ "$EUID" -ne 0 ]]
then
echo "Please run as root" >&2
exit 1
fi

function stop_sonic_services()
{
echo "Stopping syncd..."
Expand All @@ -13,8 +20,10 @@ PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
DEVPATH="/usr/share/sonic/device"
REBOOT="platform_reboot"

# Stop syncd gracefully.
stop_sonic_services

if [ -x ${DEVPATH}/${PLATFORM}/${REBOOT} ]; then
stop_sonic_services
sync
sleep 3
echo "Rebooting with platform ${PLATFORM} specific tool ..."
Expand Down