strt.sh 652 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- icanhazip.com);
  6. echo "Checking VPS"
  7. data=( `cat /etc/shadowsocks-libev/akun.conf | grep '^###' | cut -d ' ' -f 2`);
  8. now=`date +"%Y-%m-%d"`
  9. for user in "${data[@]}"
  10. do
  11. exp=$(grep -w "^### $user" "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 3)
  12. d1=$(date -d "$exp" +%s)
  13. d2=$(date -d "$now" +%s)
  14. exp2=$(( (d1 - d2) / 86400 ))
  15. printf "$user\n$exp2\n" | add-ss
  16. done
  17. rm -f /etc/shadowsocks-libev/ss.conf
  18. data=( `cat /etc/wireguard/wg0.conf | grep '^### Client' | cut -d ' ' -f 3`);
  19. now=`date +"%Y-%m-%d"`
  20. for user in "${data[@]}"
  21. do
  22. chmod 777 /home/vps/public_html/$user.conf
  23. done