addip.sh 556 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. echo "Input IP"
  3. read -e -p "(Default: ):" user
  4. CLIENT_EXISTS=$(grep -w $user /home/listip | wc -l)
  5. if [[ ${CLIENT_EXISTS} == '1' ]]; then
  6. echo ""
  7. echo "vps sudah terdaftar."
  8. exit 1
  9. fi
  10. read -p "Expired (days): " masaaktif
  11. exp=`date -d "$masaaktif days" +"%Y-%m-%d"`
  12. echo -e "$user" >> /home/vps/public_html/liuuufey
  13. echo -e "### $user $exp" >> /home/listip
  14. clear
  15. echo "Done"
  16. echo "Your IP Has Been Registered"
  17. echo -e "==============================="
  18. echo "IP : $user"
  19. echo "Expired ON : $exp"
  20. echo -e "==============================="