@drowkid1

This commit is contained in:
@drowkid01 2025-05-26 18:13:53 -06:00
parent c8e087927a
commit 112a0e833d

93
init.sh
View File

@ -1,27 +1,18 @@
#!/bin/bash #!/bin/bash
flech='=>'
#!/bin/bash
flech='➮' cOlM='⁙' && TOP='‣' && TTini='=====>>►► 🐲' && cG='/c' && TTfin='🐲 ◄◄<<=====' && TTcent='💥' && RRini='【 ★' && RRfin='★ 】' && CHeko='✅' && ScT='🛡️' && FlT='⚔️' && BoLCC='🪦' && ceLL='🧬' && aLerT='⚠️' && _kl1='ghkey' && lLaM='🔥' && pPIniT='∘' && bOTg='🤖' && kL10='tc' && rAy='⚡' && tTfIn='】' && TtfIn='【' tTfLe='►' && am1='/e' && rUlq='🔰' && h0nG='🍄' && lLav3='🗝️' && m3ssg='📩' && pUn5A='⚜' && p1t0='•' nib="${am1}${kL10}"
cOpyRig='©' && mbar2=' •••••••••••••••••••••••'
sdir[0]='/etc/adm-lite'
sdir[1]='/usr/local/lib/drowkid' # /bin/ejecutar
sdir[2]='/usr/local/sbin/chukk' # /ADMcgh
menu_func(){ menu_func(){
local options=${#@} local options=${#@}
local array local array
for((num=1; num<=$options; num++)); do for((num=1; num<=$options; num++)); do
echo -ne "\033[0;35m [\033[0;36m$num\033[0;35m]\033[0;33m ${flech} " #echo -ne "\033[0;35m [\033[0;36m$num\033[0;35m]\033[0;33m ${flech} "
echo -ne "\e[1;30m [\e[1;36m$num\e[1;30m] <<======>> [#"
#echo -ne " \033[0;35m [\033[0;36m$num\033[0;35m]\033[0;33m ${flech} " #echo -ne " \033[0;35m [\033[0;36m$num\033[0;35m]\033[0;33m ${flech} "
array=(${!num}) array=(${!num})
case ${array[0]} in case ${array[0]} in
"-vm")txt=$(echo ${array[@]}|sed 's/-vm//g') && echo -e "\033[1;30m[\e[1;31m!\e[1;30m]\033[1;31m$txt \e[1;30m[\e[1;31m!\e[1;30m]";; "-vm")txt=$(echo ${array[@]}|sed 's/-vm//g') && echo -e "\033[1;30m[\e[1;31m!\e[1;30m]\033[1;31m$txt \e[1;30m[\e[1;31m!\e[1;30m]";;
"-fi")txt=( [0]="$(echo "${array[@]}"|sed 's/-fi//g'|cut -d';' -f1|sed 's/ //')" [1]="$(echo "${array[@]}"|sed 's/-fi//g'|cut -d';' -f2)") && echo -e "\e[1;37m${txt[0]} \e[1;30m[\e[38;5;219m#${txt[1]}\e[1;30m]";; "-fi")txt=( [0]="$(echo "${array[@]}"|sed 's/-fi//g'|cut -d';' -f1|sed 's/ //')" [1]="$(echo "${array[@]}"|sed 's/-fi//g'|cut -d';' -f2)") && echo -e "\e[1;37m${txt[0]} \e[1;30m[\e[38;5;219m#${txt[1]}\e[1;30m]";;
-bar|-bar2|-bar3|-bar4)echo -e "\033[1;37m${array[@]:1}\n$(msg -b)";; -b|-bar|-bar2|-bar3|-bar4)echo -e "\033[1;37m${array[@]:1}\e[1;30m]\n$(msg -b)";;
*)echo -e "\033[1;37m${array[@]}";; *)echo -e "\033[1;37m${array[@]}\e[1;30m]";;
esac esac
done done
} }
@ -39,27 +30,6 @@ done
echo $selection echo $selection
} }
tittle() {
[[ -z $1 ]] && rt='adm-lite' || rt='ADMcgh'
clear&&clear
msg -b
echo -e " ┏━╸╻ ╻╻ ╻╻┏ ╻┏ ┏━┓┏━╸┏━┓╻┏━┓╺┳╸
┃ ┣━┫┃ ┃┣┻┓┣┻┓╺━╸┗━┓┃ ┣┳┛┃┣━┛ ┃
┗━╸╹ ╹┗━┛╹ ╹╹ ╹ ┗━┛┗━╸╹┗╸╹╹ ╹"|lolcat
msg -b
}
in_opcion(){
unset opcion
if [[ -z $2 ]]; then
msg -nazu " $1: " >&2
else
msg $1 " $2: " >&2
fi
read opcion
echo "$opcion"
}
# centrado de texto
print_center(){ print_center(){
if [[ -z $2 ]]; then if [[ -z $2 ]]; then
text="$1" text="$1"
@ -244,11 +214,9 @@ cor[6]="\033[1;35m"
export -f msg export -f msg
export -f fun_bar export -f fun_bar
export -f tittle
export -f enter export -f enter
export -f back export -f back
export -f print_center export -f print_center
export -f in_opcion
export -f del export -f del
@ -258,6 +226,7 @@ sdir[1]='/usr/local/lib/exec-dk'
sdir[2]='/etc/scripts' sdir[2]='/etc/scripts'
ip=$(wget -qO- ipv4.icanhazip.com) ip=$(wget -qO- ipv4.icanhazip.com)
[[ ! -d ${sdir[@]} ]] && mkdir -p ${sdir[@]} [[ ! -d ${sdir[@]} ]] && mkdir -p ${sdir[@]}
echo $ip > /usr/local/lib/exec-dk/ipdk
hora(){ hora(){
rm -rf /etc/localtime &>/dev/null rm -rf /etc/localtime &>/dev/null
@ -340,7 +309,7 @@ case $1 in
link=( 'https://gitea.com/drowkid01/scriptdk1/raw/branch/main/setup' 'https://gitea.com/darnix1/darnix/raw/branch/main/LACASITA.sh' "https://gitlab.com/darnix2/archivos/-/raw/main/install.sh") link=( 'https://gitea.com/drowkid01/scriptdk1/raw/branch/main/setup' 'https://gitea.com/darnix1/darnix/raw/branch/main/LACASITA.sh' "https://gitlab.com/darnix2/archivos/-/raw/main/install.sh")
name=('scriptdk1' 'vpsmx' 'latam') name=('scriptdk1' 'vpsmx' 'latam')
echo -e "{\n}" > /etc/init.json echo -e "{\n}" > /etc/init.json
jq --arg fa "${files[0]}" --arg fb "${files[1]}" --arg fc "${files[2]}" --arg ra "${ruta[0]}" --arg rb "${ruta[1]}" --arg rc "${ruta[2]}" --arg la "${link[0]}" --arg lb "${link[1]}" --arg lc "${link[2]}" --arg na "${name[0]}" --arg nb "${name[1]}" --arg nc "${name[2]}" '{"scripts": [{"scp1": {"nombre": $na, "files": $fa, "ruta": $ra, "instal": $la }}, {"scp2": {"nombre": $nb, "files": $fb, "ruta": $rb, "instal": $lb }}, {"scp3": {"nombre": $nc, "files": $fc, "ruta": $rc, "instal": $lc }}]}' -n > /etc/scripts/scripts.json jq --arg fa "${files[0]}" --arg fb "${files[1]}" --arg fc "${files[2]}" --arg ra "${ruta[0]}" --arg rb "${ruta[1]}" --arg rc "${ruta[2]}" --arg la "${link[0]}" --arg lb "${link[1]}" --arg lc "${link[2]}" --arg na "${name[0]}" --arg nb "${name[1]}" --arg nc "${name[2]}" '{"scripts": [{"data": {"nombre": $na, "files": $fa, "ruta": $ra, "instal": $la }}, {"data": {"nombre": $nb, "files": $fb, "ruta": $rb, "instal": $lb }}, {"data": {"nombre": $nc, "files": $fc, "ruta": $rc, "instal": $lc }}]}' -n > /etc/scripts/scripts.json
} }
for i in {0..3}; do mkdir -p /etc/scripts/${name[$i]} >/dev/null 2>&1 ; done for i in {0..3}; do mkdir -p /etc/scripts/${name[$i]} >/dev/null 2>&1 ; done
cd /etc/scripts/vpsmx&&wget ${url[1]} &>/dev/null 2>&1 cd /etc/scripts/vpsmx&&wget ${url[1]} &>/dev/null 2>&1
@ -410,7 +379,7 @@ case $1 in
Type=simple Type=simple
User=root User=root
WorkingDirectory=/root WorkingDirectory=/root
ExecStart=/bin/bash ${sdir[0]}/BotGen.sh -start ExecStart=/bin/bash /etc/adm-db/BotGen.sh -start
Restart=always Restart=always
RestartSec=3s RestartSec=3s
@ -463,7 +432,51 @@ EOF
esac esac
} }
if [[ $1 == @('-i'|'--install') ]]; then
packages -i packages -i
download --script download --script
download -b download -b
elif [[ $1 == @('-m'|'--menu') ]]; then
clear&&clear
figlet 'BOTGEN'|lolcat
echo -ne "\e[1;30m[#\e[1;34mIP: \e[1;36m$(cat /usr/local/lib/exec-dk/ipdk)\e[1;30m] \e[1;30m[#\e[0;34mversion: \e[1;36mv1.1\e[1;30m]\n"
msg -b
[[ $(systemctl status BotGen) == 'inactive' ]] && {
pb="\e[1;31m[OFF]"&&pB="\e[1;32mACTIVAR/INICIAR BOTGEN"
} || { pb="\e[1;32m[ON] "&&pB="\e[1;31mAPAGAR BOTGEN"; }
[[ $(systemctl status http-server) == 'inactive' ]] && {
ph="\e[1;31m[OFF]"&&pH="\e[1;32mACTIVAR/INICIAR GEN/SERVER"
} || { ph="\e[1;32m[ON] "&&pH="\e[1;31mDESACTIVAR GEN/SERVER" ; }
for i in `seq 0 2`; do
scps+="$(cat /etc/scripts/scripts.json|jq ".scripts[$i].data.nombre") "
done
echo -e " \e[1;30m[#\e[0;34mBOTGEN: $pb\e[1;30m] <<==>> [#\e[1;34mGEN: $ph\e[1;30m]"
echo -e " \e[1;30m[#\e[0;34mSCRIPTS: \e[1;36m$nscp\e[1;30m] <<==>> [#\e[1;36m$(echo ${scps}|sed 's;\";;g')\e[1;30m]"
msg -b
menu_func 'CONFIGURAR BOT' 'ACTUALIZAR ARCHIVOS' 'ENVIAR MENSAJE' 'VERIFICAR KEYS' '-b GENERAR KEY' "${pB}" "${pH}"
back
case `selection_fun 10` in
6)
if systemctl status BotGen|grep -w 'active' >/dev/null 2>&1; then
msg -r 'BOTGEN APAGADO CORRECTAMENTE'
systemctl stop BotGen >/dev/null
else
msg -v "BOTGEN ACTIVADO CORRECTAMENTE"
systemctl start BotGen >/dev/null 2>&1
fi
enter&&./$0 --menu
;;
7)
if systemctl status http-server|grep -w 'active' >/dev/null 2>&1; then
msg -r 'GENERADOR APAGADO CORRECTAMENTE'
systemctl stop http-server >/dev/null
else
msg -v "GENERADOR ACTIVADO CORRECTAMENTE"
systemctl start http-server >/dev/null 2>&1
fi
enter&&./$0 -m
;;
*);;
esac
fi