সোভেনের উত্তরের উত্তরে অ্যাড-অন হিসাবে, দুটি স্ক্রিপ্ট যা এ 2েনসাইট এবং এ 2ডিসাইটের আচরণ অনুকরণ করে। মূল ensite.sh পাওয়া যাবে গিটহাব
a2ensite.sh
#!bin/bash
# Enable a site, just like the a2ensite command.
SITES_AVAILABLE_CONFIG_DIR="/etc/httpd/sites-available";
SITES_ENABLED_CONFIG_DIR="/etc/httpd/sites-enabled";
if [ $1 ]; then
if [ -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already enabled!";
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
echo "You don't have permission to do this. Try to run the command as root."
elif [ -f "${SITES_AVAILABLE_CONFIG_DIR}/${1}" ]; then
echo "Enabling site ${1}...";
ln -s $SITES_AVAILABLE_CONFIG_DIR/$1 $SITES_ENABLED_CONFIG_DIR/$1
echo "done!"
else
echo "Site not found!"
fi
else
echo "Please, inform the name of the site to be enabled."
fi
a2dissite.sh
#!bin/bash
# Disable a site, just like a2dissite command, from Apache2.
SITES_AVAILABLE_CONFIG_DIR="/etc/httpd/sites-available";
SITES_ENABLED_CONFIG_DIR="/etc/httpd/sites-enabled";
if [ $1 ]; then
if [ ! -f "${SITES_ENABLED_CONFIG_DIR}/${1}" ]; then
echo "Site ${1} was already disabled!";
elif [ ! -w $SITES_ENABLED_CONFIG_DIR ]; then
echo "You don't have permission to do this. Try to run the command as root."
elif [ -f "${SITES_AVAILABLE_CONFIG_DIR}/${1}" ]; then
echo "Disabling site ${1}...";
unlink $SITES_ENABLED_CONFIG_DIR/$1
echo "done!"
else
echo "Site not found!"
fi
else
echo "Please, inform the name of the site to be enabled."
fi