bash - minor change

This commit is contained in:
mhsanaei 2024-10-07 17:21:32 +02:00
parent 41d39dfaa8
commit 8404b33232
No known key found for this signature in database
GPG Key ID: 4DACC0663B5986F5

15
x-ui.sh
View File

@ -833,7 +833,7 @@ ssl_cert_issue_main() {
echo "Existing domains:"
echo "$domains"
read -p "Please enter a domain from the list to revoke the certificate: " domain
if [[ " $domains " =~ " $domain " ]]; then
if echo "$domains" | grep -qw "$domain"; then
~/.acme.sh/acme.sh --revoke -d ${domain}
LOGI "Certificate revoked for domain: $domain"
else
@ -849,7 +849,7 @@ ssl_cert_issue_main() {
echo "Existing domains:"
echo "$domains"
read -p "Please enter a domain from the list to renew the SSL certificate: " domain
if [[ " $domains " =~ " $domain " ]]; then
if echo "$domains" | grep -qw "$domain"; then
~/.acme.sh/acme.sh --renew -d ${domain} --force
LOGI "Certificate forcefully renewed for domain: $domain"
else
@ -884,13 +884,13 @@ ssl_cert_issue_main() {
echo "Available domains:"
echo "$domains"
read -p "Please choose a domain to set the panel paths: " domain
if [[ " $domains " =~ " $domain " ]]; then
if echo "$domains" | grep -qw "$domain"; then
local webCertFile="/root/cert/${domain}/fullchain.pem"
local webKeyFile="/root/cert/${domain}/privkey.pem"
if [[ -f "${webCertFile}" && -f "${webKeyFile}" ]]; then
/usr/local/x-ui/x-ui cert -webCert "$webCertFile"
/usr/local/x-ui/x-ui cert -webCertKey "$webKeyFile"
/usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
echo "Panel paths set for domain: $domain"
echo " - Certificate File: $webCertFile"
echo " - Private Key File: $webKeyFile"
@ -902,6 +902,7 @@ ssl_cert_issue_main() {
fi
fi
;;
*)
echo "Invalid choice"
;;
@ -1023,8 +1024,7 @@ ssl_cert_issue() {
local webKeyFile="/root/cert/${domain}/privkey.pem"
if [[ -f "$webCertFile" && -f "$webKeyFile" ]]; then
/usr/local/x-ui/x-ui cert -webCert "$webCertFile"
/usr/local/x-ui/x-ui cert -webCertKey "$webKeyFile"
/usr/local/x-ui/x-ui cert -webCert "$webCertFile" -webCertKey "$webKeyFile"
LOGI "Panel paths set for domain: $domain"
LOGI " - Certificate File: $webCertFile"
LOGI " - Private Key File: $webKeyFile"
@ -1146,7 +1146,6 @@ run_speedtest() {
# Run Speedtest
speedtest
}
create_iplimit_jails() {
# Use default bantime if not passed => 15 minutes
local bantime="${1:-15}"