-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
82 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,87 @@ | ||
#!/bin/bash | ||
# by aria ;) | ||
|
||
# by Aria ;) | ||
clear | ||
|
||
# Sourceguardian download | ||
echo "Sourceguardian download started."; | ||
mkdir -p /usr/local/sourceguardian/ > /dev/null 2>&1; | ||
wget -O /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz > /dev/null 2>&1; | ||
tar xzf /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz > /dev/null 2>&1; | ||
chmod -R 0755 /usr/local/sourceguardian/ | ||
echo -e "Sourceguardian were downloaded.\n"; | ||
sleep 2; | ||
|
||
echo -e "Sourceguardian install started.\n"; | ||
|
||
if [[ -f "/usr/local/php56/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.5.6.lin" >> /usr/local/php56/lib/php.conf.d/90-custom.ini | ||
echo "Install sourceguardian php 5.6" | ||
elif [[ -f "/usr/local/php72/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.2.lin" >> /usr/local/php72/lib/php.conf.d/90-custom.ini | ||
echo "Install sourceguardian php 7.2" | ||
elif [[ -f "/usr/local/php73/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.3.lin" >> /usr/local/php73/lib/php.conf.d/90-custom.ini | ||
echo "Install sourceguardian php 7.3" | ||
elif [[ -f "/usr/local/php74/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.4.lin" >> /usr/local/php74/lib/php.conf.d/90-custom.ini | ||
echo "Install sourceguardian php 7.4" | ||
version="$(curl https://app.gerdoo.cloud/sg.php)"; | ||
|
||
if [[ -d "/usr/local/sourceguardian/" ]]; then | ||
if grep -R 'zend_extension = /usr/local/sourceguardian/ixed.5.6.lin' "/usr/local/php56/lib/php.conf.d/90-custom.ini" > /dev/null 2>&1; then | ||
echo "Sourceguardian was already installed in PHP 5.6" | ||
fi | ||
if grep -R 'zend_extension = /usr/local/sourceguardian/ixed.7.2.lin' "/usr/local/php72/lib/php.conf.d/90-custom.ini" > /dev/null 2>&1; then | ||
echo "Sourceguardian was already installed in PHP 7.2" | ||
fi | ||
if grep -R 'zend_extension = /usr/local/sourceguardian/ixed.7.3.lin' "/usr/local/php73/lib/php.conf.d/90-custom.ini" > /dev/null 2>&1; then | ||
echo "Sourceguardian was already installed in PHP 7.3" | ||
fi | ||
if grep -R 'zend_extension = /usr/local/sourceguardian/ixed.7.4.lin' "/usr/local/php74/lib/php.conf.d/90-custom.ini" > /dev/null 2>&1; then | ||
echo "Sourceguardian was already installed in PHP 7.4" | ||
fi | ||
if grep -q $version "/usr/local/sourceguardian/version"; then | ||
echo -e "\nSourceguardian is updated.\n"; | ||
else | ||
echo $version > /usr/local/sourceguardian/version | ||
echo -e "\nA new Sourceguardian version has been released : $version\n"; | ||
|
||
echo -e "Sourceguardian download started.\n"; | ||
|
||
mkdir -p /usr/local/sourceguardian/ > /dev/null 2>&1; | ||
echo "Create directory sourceguardian"; | ||
|
||
curl --output /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz > /dev/null 2>&1; | ||
echo "Download loader from sourceguardian"; | ||
|
||
tar -xzf /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz --directory /usr/local/sourceguardian/ > /dev/null 2>&1; | ||
echo "Extract loader file sourceguardian"; | ||
|
||
chown -R root:root /usr/local/sourceguardian/ | ||
echo "Change owner directory and file sourceguardian"; | ||
|
||
chmod -R 0755 /usr/local/sourceguardian/ | ||
echo "Change permission directory and file sourceguardian"; | ||
|
||
sleep 2; | ||
echo -e "\nSourceguardian were downloaded.\n"; | ||
fi | ||
else | ||
echo "You are not using Directadmin" | ||
fi | ||
echo -e "Sourceguardian download started.\n"; | ||
|
||
echo -e "Sourceguardian were installed.\n"; | ||
mkdir -p /usr/local/sourceguardian/ > /dev/null 2>&1; | ||
echo "Create directory sourceguardian"; | ||
|
||
curl --output /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz > /dev/null 2>&1; | ||
echo "Download loader from sourceguardian"; | ||
|
||
tar -xzf /usr/local/sourceguardian/loaders.linux-x86_64.tar.gz --directory /usr/local/sourceguardian/ > /dev/null 2>&1; | ||
echo "Extract loader file sourceguardian"; | ||
|
||
chown -R root:root /usr/local/sourceguardian/ | ||
echo "Change owner directory and file sourceguardian"; | ||
|
||
chmod -R 0755 /usr/local/sourceguardian/ | ||
echo "Change permission directory and file sourceguardian"; | ||
|
||
sleep 2; | ||
echo -e "\nSourceguardian were downloaded.\n"; | ||
|
||
echo -e "Sourceguardian install started.\n"; | ||
|
||
if [[ -f "/usr/local/php56/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.5.6.lin" >> /usr/local/php56/lib/php.conf.d/90-custom.ini | ||
echo "Sourceguardian is installed in PHP 5.6" | ||
fi | ||
if [[ -f "/usr/local/php72/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.2.lin" >> /usr/local/php72/lib/php.conf.d/90-custom.ini | ||
echo "Sourceguardian is installed in PHP 7.2" | ||
fi | ||
if [[ -f "/usr/local/php73/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.3.lin" >> /usr/local/php73/lib/php.conf.d/90-custom.ini | ||
echo "Sourceguardian is installed in PHP 7.3" | ||
fi | ||
if [[ -f "/usr/local/php74/lib/php.conf.d/90-custom.ini" ]]; then | ||
echo "zend_extension = /usr/local/sourceguardian/ixed.7.4.lin" >> /usr/local/php74/lib/php.conf.d/90-custom.ini | ||
echo "Sourceguardian is installed in PHP 7.4" | ||
fi | ||
|
||
echo -e "\nSourceguardian were installed.\n"; | ||
fi |