Skip to content

Commit

Permalink
Avoid depricate shell methods in fast-reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-shirshov committed Mar 31, 2017
1 parent 67102b3 commit 058959d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ then
fi

# Unload previous kernel if any loaded
if [ "x`cat /sys/kernel/kexec_loaded`y" = "x1y" ]
if [ $(cat /sys/kernel/kexec_loaded) -eq 1 ]
then
/sbin/kexec -u
fi

# Kernel and initrd image
KERNEL_IMAGE="/vmlinuz"
INITRD="/initrd.img"
BOOT_OPTIONS="`cat /proc/cmdline`"
BOOT_OPTIONS=$(cat /proc/cmdline)

case "$BOOT_OPTIONS" in
*fast-reboot*)
Expand All @@ -35,11 +35,8 @@ systemctl stop docker.service

# Wait until all buffers synced with disk
sync
sleep 1
sleep 3
sync
sleep 1
sync
sleep 1

# Reboot
reboot

0 comments on commit 058959d

Please sign in to comment.