linux下实现分区切换

#!/bin/bash
SHPATH=`cd $(dirname $0); pwd -P`

# args
CONSOLE=/dev/ttyTCU0
APP_PART_CONFIG=/home/novasky/config/system/app-block-device

APP_PART=`mount | grep '/home/novasky/app ' | awk '{print $1}'`
APP_PART_BAK=`mount | grep '/home/novasky/app-backup ' | awk '{print $1}'`

sync

echo $APP_PART_BAK >$APP_PART_CONFIG

sync

if [[ `cat $APP_PART_CONFIG` == $APP_PART_BAK ]]; then
    echo "SUCCESS: switch app partition to $APP_PART_BAK"
    exit 0
else
    echo "FAILURE: switch app partition to $APP_PART_BAK"
    exit -1
fi

你可能感兴趣的:(linux,服务器,前端,c语言)