| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #!/bin/bash
- # info: remove ssl force from domain
- # options: USER DOMAIN [RESTART]
- #
- # The function removes force SSL configurations.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- user=$1
- domain=$2
- restart=$3
- # Includes
- source $HESTIA/func/main.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '2' "$#" 'USER DOMAIN'
- is_format_valid 'user' 'domain' 'ssl_dir'
- is_object_valid 'user' 'USER' "$user"
- is_object_unsuspended 'user' 'USER' "$user"
- is_object_valid 'web' 'DOMAIN' "$domain"
- is_object_unsuspended 'web' 'DOMAIN' "$domain"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Load domain data
- eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
- # Remove forcessl configs
- rm -f /home/$user/conf/web/forcessl.*$domain*.conf
- #----------------------------------------------------------#
- # Hestia #
- #----------------------------------------------------------#
- # Restart services if requested
- if [ ! -z "$restart" ]; then
- $BIN/v-restart-web
- check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- check_result $? "Proxy restart failed" >/dev/null
- fi
- exit
|