mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-11 18:58:18 +00:00
bash - minor change
This commit is contained in:
parent
41d39dfaa8
commit
8404b33232
1 changed files with 21 additions and 22 deletions
21
x-ui.sh
21
x-ui.sh
|
@ -181,7 +181,7 @@ update_menu() {
|
|||
chmod +x /usr/local/x-ui/x-ui.sh
|
||||
chmod +x /usr/bin/x-ui
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
if [[ $? == 0 ]]; then
|
||||
echo -e "${green}Update successful. The panel has automatically restarted.${plain}"
|
||||
exit 0
|
||||
else
|
||||
|
@ -216,7 +216,7 @@ custom_version() {
|
|||
|
||||
# Function to handle the deletion of the script file
|
||||
delete_script() {
|
||||
rm "$0" # Remove the script file itself
|
||||
rm "$0" # Remove the script file itself
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
@ -796,7 +796,7 @@ install_acme() {
|
|||
fi
|
||||
|
||||
LOGI "Installing acme.sh..."
|
||||
cd ~ || return 1 # Ensure you can change to the home directory
|
||||
cd ~ || return 1 # Ensure you can change to the home directory
|
||||
|
||||
curl -s https://get.acme.sh | sh
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue