#!/bin/sh
PATCH_START()
{
    #add your code here
    return 
}
PATCH_END()
{
    #add your code here   
    
    tar -xf /ISM/cli_v5r7C61_DTS2021102511615.tgz -C /ISM/cli/cmd_autogen/

    chown -R 65500:1100 /ISM/cli/cmd_autogen/show.lun.snapshot
    chmod -R 500 /ISM/cli/cmd_autogen/show.lun.snapshot
    chmod -R 400 /ISM/cli/cmd_autogen/show.lun.snapshot/*

    #restart server
    killall -s 9 CLI_Server

    return
}
PATCH_ROLLBACK()
{
    #add your code here
    #rollback file	
    rm -rf /ISM/cli/cmd_autogen/show.lun.snapshot
    
    #restart server
    killall -s 9 CLI_Server

    return
}
PATCH_ROLLEND()
{
    #add your code here
    return
}
L_CMD=$1
case $L_CMD in
    "start") PATCH_START
               ;;
    "end") PATCH_END
               ;;
    "rollstart") PATCH_ROLLBACK
               ;;
    "rollend") PATCH_ROLLEND
  ;;
    *)
        OS_echo "unsupported option."
esac
exit 0
