Files
AUV_150/scripts/clear.sh
2025-08-12 13:10:10 +08:00

28 lines
660 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 配置变量
REMOTE_USER="auv"
REMOTE_HOST="192.168.1.200"
REMOTE_PATH="/home/auv/software/AUV_150/missions/auv150"
# 定义远程文件路径
REMOTE_FILE="$REMOTE_PATH/AUV150.db"
# 检查是否安装了ssh
echo "检查ssh命令..."
if ! command -v ssh &> /dev/null; then
echo "错误: 未找到ssh命令请安装openssh客户端"
exit 1
fi
# 删除远程文件
echo "正在删除远程主机 $REMOTE_HOST 上的文件 $REMOTE_FILE..."
ssh "$REMOTE_USER@$REMOTE_HOST" "rm -f $REMOTE_FILE"
# 检查删除是否成功
if [ $? -eq 0 ]; then
echo "远程文件删除成功!"
else
echo "远程文件删除失败!"
exit 1
fi