30 Opensource
This commit is contained in:
155
install.sh
155
install.sh
@@ -11,7 +11,6 @@ fi
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg curl wget
|
||||
|
||||
if [ "$system" = "debian" ]; then
|
||||
repos=$(find /etc/apt/ -name '*.list' -exec cat {} + | grep ^[[:space:]]*deb | grep -q "packages.sury.org/php" && echo 1 || echo 0)
|
||||
if [ "$repos" = "0" ]; then
|
||||
@@ -23,111 +22,11 @@ else
|
||||
repos=$(find /etc/apt/ -name '*.list' -exec cat {} + | grep ^[[:space:]]*deb | grep -q "/ondrej/php" && echo 1 || echo 0)
|
||||
if [ "$repos" = "0" ]; then
|
||||
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
|
||||
sudo add-apt-repository ppa:ondrej/php
|
||||
sudo add-apt-repository ppa:ondrej/php -y
|
||||
sudo apt update
|
||||
fi
|
||||
fi
|
||||
|
||||
php_version="$(command php --version 2>'/dev/null' \
|
||||
| command head -n 1 \
|
||||
| command cut --characters=5-7)"
|
||||
if [ "$system" = "ubuntu" ] && [ "$(lsb_release -rs)" = "18.04" ]; then
|
||||
sudo apt install php7.2-cli php7.2-curl php7.2-sqlite3 php7.2-pgsql git -y
|
||||
cake=$(uname -m)
|
||||
if [ "$cake" = "x86_64" ]; then
|
||||
wget --user-agent "Mozilla" http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
|
||||
tar -xvzf loaders.linux-x86_64.tar.gz
|
||||
rm loaders.linux-x86_64.tar.gz
|
||||
else
|
||||
wget --user-agent "Mozilla" https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz
|
||||
tar -xvzf loaders.linux-aarch64.tar.gz
|
||||
rm loaders.linux-aarch64.tar.gz
|
||||
fi
|
||||
sudo mv ixed.7.2.lin $(php -i | grep extension_dir | awk '{print $3}' | head -n 1)
|
||||
|
||||
elif [ "$system" = "ubuntu" ] && [ "$(lsb_release -rs)" = "20.04" ]; then
|
||||
sudo apt install php7.4-cli php7.4-curl php7.4-sqlite3 php7.4-pgsql git -y
|
||||
cake=$(uname -m)
|
||||
if [ "$cake" = "x86_64" ]; then
|
||||
wget --user-agent "Mozilla" http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
|
||||
tar -xvzf loaders.linux-x86_64.tar.gz
|
||||
rm loaders.linux-x86_64.tar.gz
|
||||
else
|
||||
wget --user-agent "Mozilla" https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz
|
||||
tar -xvzf loaders.linux-aarch64.tar.gz
|
||||
rm loaders.linux-aarch64.tar.gz
|
||||
fi
|
||||
sudo mv ixed.7.4.lin $(php -i | grep extension_dir | awk '{print $3}' | head -n 1)
|
||||
|
||||
elif [ "$php_version" != "8.1" ]; then
|
||||
sudo apt purge php-cli php-curl php-sqlite3 php-pgsql -y
|
||||
sudo apt purge php8.2-cli php8.2-curl php8.2-sqlite3 git -y
|
||||
sudo apt autoremove -y
|
||||
sudo apt install php8.1-cli php8.1-curl php8.1-sqlite3 php8.1-pgsql git -y
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
|
||||
PREFERENCES_FILE="/etc/apt/preferences.d/php-pin-8.1.pref"
|
||||
if [ ! -f "$PREFERENCES_FILE" ]; then
|
||||
sudo tee "$PREFERENCES_FILE" <<EOF
|
||||
Package: php*
|
||||
Pin: version 8.1*
|
||||
Pin-Priority: 1001
|
||||
EOF
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
fi
|
||||
php_version="$(command php --version 2>'/dev/null' \
|
||||
| command head -n 1 \
|
||||
| command cut --characters=5-7)"
|
||||
if [ "$cake" = "x86_64" ]; then
|
||||
wget --user-agent "Mozilla" http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
|
||||
tar -xvzf loaders.linux-x86_64.tar.gz
|
||||
rm loaders.linux-x86_64.tar.gz
|
||||
else
|
||||
wget --user-agent "Mozilla" https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz
|
||||
tar -xvzf loaders.linux-aarch64.tar.gz
|
||||
rm loaders.linux-aarch64.tar.gz
|
||||
fi
|
||||
sudo mv ixed.${php_version}.lin $(php -i | grep extension_dir | awk '{print $3}' | head -n 1)
|
||||
else
|
||||
|
||||
sudo apt install php8.1-cli php8.1-curl php8.1-sqlite3 php8.1-pgsql git -y
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
|
||||
PREFERENCES_FILE="/etc/apt/preferences.d/php-pin-8.1.pref"
|
||||
if [ ! -f "$PREFERENCES_FILE" ]; then
|
||||
sudo tee "$PREFERENCES_FILE" <<EOF
|
||||
Package: php*
|
||||
Pin: version 8.1*
|
||||
Pin-Priority: 1001
|
||||
EOF
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
fi
|
||||
php_version="$(command php --version 2>'/dev/null' \
|
||||
| command head -n 1 \
|
||||
| command cut --characters=5-7)"
|
||||
if [ "$cake" = "x86_64" ]; then
|
||||
wget --user-agent "Mozilla" http://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
|
||||
tar -xvzf loaders.linux-x86_64.tar.gz
|
||||
rm loaders.linux-x86_64.tar.gz
|
||||
else
|
||||
wget --user-agent "Mozilla" https://www.sourceguardian.com/loaders/download/loaders.linux-aarch64.tar.gz
|
||||
tar -xvzf loaders.linux-aarch64.tar.gz
|
||||
rm loaders.linux-aarch64.tar.gz
|
||||
fi
|
||||
sudo mv ixed.${php_version}.lin $(php -i | grep extension_dir | awk '{print $3}' | head -n 1)
|
||||
fi
|
||||
php_version2="$(command php --version 2>'/dev/null' \
|
||||
| command head -n 1 \
|
||||
| command cut --characters=5-7)"
|
||||
cat > /etc/php/${php_version2}/cli/conf.d/sourceguardian.ini << EOF
|
||||
zend_extension=ixed.${php_version2}.lin
|
||||
EOF
|
||||
rm ixed.*
|
||||
rm README
|
||||
rm "SourceGuardian Loader License.pdf"
|
||||
rm version
|
||||
sudo apt install -y php-cli php-curl php-sqlite3 php-pgsql git
|
||||
|
||||
if [ ! -e "/bin/php" ]; then
|
||||
sudo ln -s "$(command -v php)" /bin/php
|
||||
@@ -135,37 +34,53 @@ fi
|
||||
|
||||
cd /opt/
|
||||
rm -rf DragonCore
|
||||
cd $HOME
|
||||
cd "$HOME"
|
||||
|
||||
git clone https://git.dr2.site/penguinehis/DragonCoreSSH-Beta.git /opt/DragonCore
|
||||
rm -rf /opt/DragonCore/aarch64
|
||||
rm -rf /opt/DragonCore/x86_64
|
||||
rm -rf /opt/DragonCore/install.sh
|
||||
curl -s -L -o /opt/DragonCore/menu https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/menu
|
||||
|
||||
curl -s -L -o /opt/DragonCore/menu https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/menu
|
||||
curl -s -L -o /opt/DragonCore/dragon_go https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/dragon_go
|
||||
curl -s -L -o /opt/DragonCore/badvpn-udpgw https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/badvpn-udpgw
|
||||
curl -s -L -o /opt/DragonCore/libcrypto.so.3 https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/libcrypto.so.3
|
||||
curl -s -L -o /opt/DragonCore/libssl.so.3 https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/libssl.so.3
|
||||
curl -s -L -o /opt/DragonCore/ProxyDragon https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/ProxyDragon
|
||||
curl -s -L -o /opt/DragonCore/ulekbot https://git.dr2.site/penguinehis/DragonCoreSSH-Beta/raw/branch/main/$(uname -m)/ulekbot
|
||||
|
||||
cd /opt/DragonCore
|
||||
chmod +x *
|
||||
cd $HOME
|
||||
cd "$HOME"
|
||||
|
||||
echo -n "/opt/DragonCore/menu" > /bin/menu
|
||||
chmod +x /bin/menu
|
||||
|
||||
existing_cron=$(crontab -l 2>/dev/null | grep -F "*/5 * * * * find /run/user -maxdepth 1 -mindepth 1 -type d -exec mount -o remount,size=1M {} \;")
|
||||
if [ -z "$existing_cron" ]; then
|
||||
(crontab -l 2>/dev/null; echo "*/5 * * * * find /run/user -maxdepth 1 -mindepth 1 -type d -exec mount -o remount,size=1M {} \;") | crontab -
|
||||
(crontab -l 2>/dev/null; echo "*/5 * * * * find /run/user -maxdepth 1 -mindepth 1 -type d -exec mount -o remount,size=1M {} \;") | crontab -
|
||||
fi
|
||||
|
||||
existing_crono=$(crontab -l 2>/dev/null | grep -F "@reboot sleep 30 && /usr/bin/php /opt/DragonCore/menu.php autostart")
|
||||
if [ -z "$existing_crono" ]; then
|
||||
(crontab -l 2>/dev/null; echo "@reboot sleep 30 && /usr/bin/php /opt/DragonCore/menu.php autostart") | crontab -
|
||||
(crontab -l 2>/dev/null; echo "@reboot sleep 30 && /usr/bin/php /opt/DragonCore/menu.php autostart") | crontab -
|
||||
fi
|
||||
|
||||
existing_lima=$(crontab -l 2>/dev/null | grep -F '@reboot sleep 30 && find /etc/DragonTeste -name "*.sh" -exec {} \;')
|
||||
if [ -z "$existing_lima" ]; then
|
||||
(crontab -l 2>/dev/null; echo '@reboot sleep 30 && find /etc/DragonTeste -name "*.sh" -exec {} \;') | crontab -
|
||||
fi
|
||||
|
||||
if dpkg -s libssl1.1 &>/dev/null; then
|
||||
echo "libssl1.1 is already installed."
|
||||
else
|
||||
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee /etc/apt/sources.list.d/focal-security.list
|
||||
apt-get update && apt-get install -y libssl1.1
|
||||
fi
|
||||
|
||||
bash <(php /opt/DragonCore/postinstall.php installpostgre)
|
||||
#Gerar DBS:
|
||||
|
||||
# Gerar DBS:
|
||||
php /opt/DragonCore/menu.php createautostart
|
||||
php /opt/DragonCore/menu.php createTable
|
||||
php /opt/DragonCore/menu.php createdbdragon
|
||||
@@ -173,15 +88,18 @@ php /opt/DragonCore/menu.php createv2table
|
||||
php /opt/DragonCore/dbconvert.php convertdba
|
||||
php /opt/DragonCore/dbconvert.php finishdba
|
||||
php /opt/DragonCore/menu.php deletecone ws
|
||||
sed -i '/# HostKeyAlgorithms/ a\HostKeyAlgorithms +ssh-rsa' /etc/ssh/sshd_config
|
||||
sed -i '/# PubkeyAcceptedKeyTypes/ a\PubkeyAcceptedKeyTypes +ssh-rsa' /etc/ssh/sshd_config
|
||||
|
||||
sed -i '/# HostKeyAlgorithms/ a\HostKeyAlgorithms +ssh-rsa' /etc/ssh/sshd_config
|
||||
sed -i '/# PubkeyAcceptedKeyTypes/ a\PubkeyAcceptedKeyTypes +ssh-rsa' /etc/ssh/sshd_config
|
||||
|
||||
reposi2=$(find /etc/apt/ -name *.list | xargs cat | grep ^[[:space:]]*deb | grep -q "ookla" && echo 1 || echo 0)
|
||||
if [ "$reposi2" = "1" ]; then
|
||||
echo "OK"
|
||||
echo "OK"
|
||||
else
|
||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash
|
||||
apt install speedtest
|
||||
apt install -y speedtest
|
||||
fi
|
||||
|
||||
install_netstat() {
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
@@ -191,8 +109,8 @@ install_netstat() {
|
||||
else
|
||||
echo "Netstat is not installed. Trying to install..."
|
||||
if [ -x "$(command -v apt)" ]; then
|
||||
apt update
|
||||
apt install -y net-tools
|
||||
apt update
|
||||
apt install -y net-tools
|
||||
echo -e "${GREEN}Netstat installation complete.${NC}"
|
||||
else
|
||||
echo -e "${RED}Unsupported system. Please install netstat manually.${NC}"
|
||||
@@ -200,7 +118,8 @@ install_netstat() {
|
||||
fi
|
||||
}
|
||||
install_netstat
|
||||
#continua o script
|
||||
|
||||
# continua o script
|
||||
screen -X -S proxydragon quit
|
||||
screen -X -S openvpn quit
|
||||
screen -X -S badvpn quit
|
||||
@@ -208,8 +127,10 @@ screen -X -S checkuser quit
|
||||
screen -X -S napster quit
|
||||
screen -X -S limiter quit
|
||||
screen -X -S botulek quit
|
||||
|
||||
php /opt/DragonCore/menu.php autostart
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Script instalado use o comando menu"
|
||||
echo "Script instalado use o comando menu"
|
||||
|
||||
Reference in New Issue
Block a user