Browse Source

feat: Add macOS system check and configuration restore feature to Cursor MAC ID modifier

- Implemented system check to ensure script runs only on macOS
- Added new restore functionality to recover previous configuration from backups
- Enhanced script with user-friendly backup file selection
- Improved error handling and system compatibility
pull/217/head v0.0.85
煎饼果子卷鲨鱼辣椒 4 months ago
parent
commit
b4fd75079c
  1. 24
      scripts/run/cursor_mac_id_modifier.sh

24
scripts/run/cursor_mac_id_modifier.sh

@ -536,8 +536,29 @@ modify_mac_address() {
fi fi
} }
# 新增恢复功能选项
add_restore_feature() {
local backup_files=("$BACKUP_DIR"/*.backup_*)
echo "可用的备份文件:"
select backup in "${backup_files[@]}"; do
if [ -n "$backup" ]; then
cp "$backup" "$STORAGE_FILE"
log_info "已从备份恢复配置"
break
fi
done
}
# 主函数 # 主函数
main() { main() {
# 新增环境检查
if [[ $(uname) != "Darwin" ]]; then
log_error "本脚本仅支持 macOS 系统"
exit 1
fi
clear clear
# 显示 Logo # 显示 Logo
echo -e " echo -e "
@ -586,6 +607,9 @@ main() {
log_info "请重启 Cursor 以应用新的配置" log_info "请重启 Cursor 以应用新的配置"
# 显示最后的提示信息 # 显示最后的提示信息
show_follow_info show_follow_info
# 新增恢复功能选项
restore_feature
} }
# 执行主函数 # 执行主函数

Loading…
Cancel
Save