strt.sh 550 B

123456789101112131415161718
  1. #!/bin/bash
  2. data=( `cat /etc/shadowsocks-libev/ss.conf | grep '^###' | cut -d ' ' -f 2`);
  3. now=`date +"%Y-%m-%d"`
  4. for user in "${data[@]}"
  5. do
  6. exp=$(grep -w "^### $user" "/etc/shadowsocks-libev/ss.conf" | cut -d ' ' -f 3)
  7. d1=$(date -d "$exp" +%s)
  8. d2=$(date -d "$now" +%s)
  9. exp2=$(( (d1 - d2) / 86400 ))
  10. printf "$user\n$exp2\n" | addss
  11. done
  12. rm -f /etc/shadowsocks-libev/ss.conf
  13. data=( `cat /etc/wireguard/wg0.conf | grep '^### Client' | cut -d ' ' -f 3`);
  14. now=`date +"%Y-%m-%d"`
  15. for user in "${data[@]}"
  16. do
  17. chmod 777 /home/vps/public_html/$user.conf
  18. done