#!/bin/bash
# info: delete vesta softaculous
# options: NONE
#
# The script disables softaculous plugin


#----------------------------------------------------------#
#                    Variable&Function                     #
#----------------------------------------------------------#

# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf


#----------------------------------------------------------#
#                    Verifications                         #
#----------------------------------------------------------#

if [ "$SOFTACULOUS" = 'no' ] || [ -z "$SOFTACULOUS" ]; then
    exit
fi


#----------------------------------------------------------#
#                       Action                             #
#----------------------------------------------------------#

# Deleting symlink
if [ -e "$VESTA/web/softaculous" ]; then
    mkdir -p $VESTA/disabled_plugins
    mv $VESTA/web/softaculous $VESTA/disabled_plugins
fi

# Updating SOFTACULOUS value
sed -i "s/SOFTACULOUS.*/SOFTACULOUS='no'/g" \
        $VESTA/conf/vesta.conf


#----------------------------------------------------------#
#                       Vesta                              #
#----------------------------------------------------------#

# Logging
log_event "$OK" "$ARGUMENTS"

exit