分类 VPS 下的文章

#!/bin/sh
. /etc/profile
. /root/.bashrc
cd /xxxxx/xxxxx
sold=`stat -c %Y snews.html` # 文件修改时间戳
snew=`date +%s` # 系统当前时间戳
sdiff=$[$snew-$sold]
sload=`uptime | awk -F 'load average: ' '{print $2}'| awk -F ', ' '{print $1}'| awk -F '.' '{print $1}'`
if [ $sdiff -gt 700 ];then # 文件太旧,需要重启系统
  if [$sload -gt "0"];then
    echo "File Read Only, but loading > 1, waiting to reboot"
  else
    curl http://sc.ftqq.com/xxxxx.send?text=RebootCEforFileReadOnly
    reboot
  if
fi

设置要永久加入到path环境变量中的路径

set My_PATH=c:\swds\software\cmder
set PATH=%PATH%;%My_PATH%
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /t REG_EXPAND_SZ /d "%PATH%" /f
pause

@echo off
:start
for /f "tokens=16" %%i in ('ipconfig ^|find /i "ipv6"') do set ip=%%i
curl -s -x socks5://127.0.0.1:1080 "https://dyn.dns.he.net/nic/update?hostname=xx.xx&password=xxxxxx&myip=%ip%"
choice /t 600 /d y /m "_ %date% %time% Waiting 600s"
goto start

curl -s隐藏进度条 -x代理
choice /t等待秒 /d默认回答y /m显示提示语