mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-18 07:17:35 +02:00
utility 2
This commit is contained in:
@@ -44,15 +44,19 @@ wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_uti
|
||||
chmod 700 /usr/bin/cyberpanel_utility
|
||||
fi
|
||||
|
||||
if ! cat /root/.bashrc | grep -q cyberpanel_utility ; then
|
||||
if ! cat /etc/bash.bashrc | grep -q cyberpanel_utility ; then
|
||||
echo -e "\n\ncyberpanel() {
|
||||
if [[ $1 == "utility" ]] ; then
|
||||
/usr/bin/cyberpanel_utility ${@:2:99}
|
||||
elif [[ $1 == "help" ]] ; then
|
||||
/usr/bin/cyberpanel_utility --help
|
||||
elif [[ $1 == "upgrade" ]] || [[ $1 == "update" ]] ; then
|
||||
/usr/bin/cyberpanel_utility --upgrade
|
||||
else
|
||||
/usr/bin/cyberpanel "$@"
|
||||
fi
|
||||
}" >> /root/.bashrc
|
||||
source /root/.bashrc
|
||||
}" >> /etc/bash.bashrc
|
||||
source /etc/bash.bashrc
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,28 @@ SUDO_TEST=$(set)
|
||||
SERVER_OS='Undefined'
|
||||
OUTPUT=$(cat /etc/*release)
|
||||
|
||||
install_utility() {
|
||||
if [[ ! -f /usr/bin/cyberpanel_utility ]] ; then
|
||||
wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh
|
||||
chmod 700 /usr/bin/cyberpanel_utility
|
||||
fi
|
||||
|
||||
if ! cat /etc/bash.bashrc | grep -q cyberpanel_utility ; then
|
||||
echo -e "\n\ncyberpanel() {
|
||||
if [[ $1 == "utility" ]] ; then
|
||||
/usr/bin/cyberpanel_utility ${@:2:99}
|
||||
elif [[ $1 == "help" ]] ; then
|
||||
/usr/bin/cyberpanel_utility --help
|
||||
elif [[ $1 == "upgrade" ]] || [[ $1 == "update" ]] ; then
|
||||
/usr/bin/cyberpanel_utility --upgrade
|
||||
else
|
||||
/usr/bin/cyberpanel "$@"
|
||||
fi
|
||||
}" >> /etc/bash.bashrc
|
||||
source /etc/bash.bashrc
|
||||
fi
|
||||
}
|
||||
|
||||
check_root() {
|
||||
echo -e "\nChecking root privileges...\n"
|
||||
if echo $SUDO_TEST | grep SUDO > /dev/null ; then
|
||||
@@ -147,6 +169,10 @@ cp lswsgi /usr/local/CyberCP/bin/
|
||||
|
||||
chmod 700 /usr/bin/adminPass
|
||||
|
||||
install_utility
|
||||
|
||||
|
||||
|
||||
##
|
||||
systemctl restart lscpd
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ if [[ $TMP_YN == "1" ]] ; then
|
||||
if [[ ! -f /etc/cyberpanel/watchdog.sh ]] ; then
|
||||
echo -e "\nWatchDog no found..."
|
||||
wget -O /etc/cyberpanel/watchdog.sh https://cyberpanel.sh/misc/watchdog.sh
|
||||
chmod +x /etc/cyberpanel/watchdog.sh
|
||||
chmod 700 /etc/cyberpanel/watchdog.sh
|
||||
ln -s /etc/cyberpanel/watchdog.sh /usr/local/bin/watchdog
|
||||
echo -e "\nWatchDos has been installed..."
|
||||
set_watchdog
|
||||
@@ -105,13 +105,13 @@ cyberpanel_upgrade() {
|
||||
echo -e "CyberPanel upgrading..."
|
||||
rm -f /usr/local/cyberpanel_upgrade.sh
|
||||
wget -O /usr/local/cyberpanel_upgrade.sh -q https://raw.githubusercontent.com/usmannasir/cyberpanel/$BRANCH_NAME/cyberpanel_upgrade.sh
|
||||
chmod +x /usr/local/cyberpanel_upgrade.sh
|
||||
chmod 700 /usr/local/cyberpanel_upgrade.sh
|
||||
/usr/local/cyberpanel_upgrade.sh
|
||||
rm -f /usr/local/cyberpanel_upgrade.sh
|
||||
exit
|
||||
}
|
||||
|
||||
get_faq() {
|
||||
show_help() {
|
||||
echo -e "\nFetching information...\n"
|
||||
curl https://cyberpanel.sh/misc/faq.txt
|
||||
exit
|
||||
@@ -184,12 +184,6 @@ sudo_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
show_help() {
|
||||
echo -e "\nCyberPanel Utility Script"
|
||||
echo -e "\nYou can use argument --upgrade to run CyberPanel upgrade without interaction for automated job."
|
||||
echo -e "\nExample: cyberpanel utility --upgrade"
|
||||
exit
|
||||
}
|
||||
|
||||
panel_check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user