Mini Shell
#!/usr/bin/bash
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
action=$1 # register | unregister
ROOT_CPANEL_DIR="/usr/local/cpanel/whostmgr/docroot/"
SOURCE_PATH="/usr/share/l.v.e-manager/"
cpanel_version="native"
if [[ "$action" == "register" ]] && [[ ! -f /var/cpanel/apps/lvemanager.conf ]]; then
if [[ ! -d /var/cpanel/apps ]]; then
mkdir -p /var/cpanel/apps
chmod 755 /var/cpanel/apps/
fi
# Copy logo
cp -fv "$SOURCE_PATH"cpanel/images/Cloudlinux_icon.png \
"$ROOT_CPANEL_DIR"addon_plugins
# Register plugin
if [[ ! -z "$2" ]]; then
cpanel_version=$2
fi
/usr/local/cpanel/bin/register_appconfig \
"$SOURCE_PATH"cpanel/lvemanager-"$cpanel_version".conf
# Create simlink to main processing script
ln -s "$ROOT_CPANEL_DIR"cgi/CloudLinux.cgi \
"$ROOT_CPANEL_DIR"cgi/addon_lvemanager.cgi
/usr/local/cpanel/etc/init/startcpsrvd
elif [[ "$action" == "unregister" ]] && [[ -f /var/cpanel/apps/lvemanager.conf ]]; then
# Unregister plugin
/usr/local/cpanel/bin/unregister_appconfig \
"$SOURCE_PATH/cpanel/lvemanager-native.conf"
rm -f "$ROOT_CPANEL_DIR"cgi/addon_lvemanager.cgi
rm -f "$ROOT_CPANEL_DIR"addon_plugins/Cloudlinux_icon.png
/usr/local/cpanel/etc/init/startcpsrvd
fi
Zerion Mini Shell 1.0