strt.sh 657 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. clear
  8. data=( `cat /etc/shadowsocks-libev/akun.conf | grep '^###' | cut -d ' ' -f 2`);
  9. now=`date +"%Y-%m-%d"`
  10. for user in "${data[@]}"
  11. do
  12. exp=$(grep -w "^### $user" "/etc/shadowsocks-libev/akun.conf" | cut -d ' ' -f 3)
  13. d1=$(date -d "$exp" +%s)
  14. d2=$(date -d "$now" +%s)
  15. exp2=$(( (d1 - d2) / 86400 ))
  16. printf "$user\n$exp2\n" | add-ss
  17. done
  18. rm -f /etc/shadowsocks-libev/ss.conf
  19. data=( `cat /etc/wireguard/wg0.conf | grep '^### Client' | cut -d ' ' -f 3`);
  20. now=`date +"%Y-%m-%d"`
  21. for user in "${data[@]}"
  22. do
  23. chmod 777 /home/vps/public_html/$user.conf
  24. done