AOSP在MAC环境在编译

本文提供了适用于MAC与Linux环境下的实用脚本,包括自动重连VIP-TW-P VPN服务的AppleScript脚本以及通过nmcli检查并重连特定UUID的Linux VPN连接的bash脚本。此外还分享了一个使用repo工具进行断点续传的简单bash脚本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MAC环境下VPN重连脚本:

on idle
tell application "System Events"
tell current location of network preferences
set myConnection to the service "VIP-TW -P"
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
return 10
end tell
end idle


140639_Qc04_2433273.png140538_L40h_2433273.png





Linux环境下VPN重连脚本:

#!/bin/bash 
connect="5"
while [ "true" ]
 do 
    VPNCON=$(nmcli con show uuid 117fcee0-d5b5-4964-9025-bef5efe9053f | grep VPN.VPN-STATE | awk '{print $2}')	
    echo $VPNCON    	
    if [ "$VPNCON" != "$connect" ];then 
    echo "Disconnected, trying to reconnect..."         	
        (sleep 1s && nmcli con up uuid 117fcee0-d5b5-4964-9025-bef5efe9053f)     
    else 
         echo "Already connected !"     	
    fi 
    sleep 5	
done


repo 断点续传脚本:

$?=1
while [ $? -ne 0 ] ;
do  repo sync ;
done


转载于:https://my.oschina.net/fonddream/blog/517073

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值