-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
477 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# Set aspect-ration. | ||
aspect = 0 | ||
|
||
# Set separator (for multiple widgets output). | ||
separate_widget = "" | ||
|
||
# Set tab-length (for textbox tab-conversion). | ||
tab_len = 0 | ||
|
||
# Make tab-traversal for checklist, etc., include the list. | ||
visit_items = ON | ||
|
||
# Shadow dialog boxes? This also turns on color. | ||
use_shadow = ON | ||
|
||
# Turn color support ON or OFF | ||
use_colors = ON | ||
|
||
# Screen color | ||
screen_color = (GREEN,RED,ON) | ||
|
||
# Shadow color | ||
shadow_color = (WHITE,BLACK,ON) | ||
|
||
# Dialog box color | ||
dialog_color = (BLACK,WHITE,ON) | ||
|
||
# Dialog box title color | ||
title_color = (RED,WHITE,ON) | ||
|
||
# Dialog box border color | ||
border_color = (WHITE,WHITE,ON) | ||
|
||
# Active button color | ||
button_active_color = (WHITE,BLUE,ON) | ||
|
||
# Inactive button color | ||
button_inactive_color = dialog_color | ||
|
||
# Active button key color | ||
button_key_active_color = button_active_color | ||
|
||
# Inactive button key color | ||
button_key_inactive_color = (RED,WHITE,ON) | ||
|
||
# Active button label color | ||
button_label_active_color = (YELLOW,BLUE,ON) | ||
|
||
# Inactive button label color | ||
button_label_inactive_color = (BLACK,WHITE,ON) | ||
|
||
# Input box color | ||
inputbox_color = dialog_color | ||
|
||
# Input box border color | ||
inputbox_border_color = dialog_color | ||
|
||
# Search box color | ||
searchbox_color = dialog_color | ||
|
||
# Search box title color | ||
searchbox_title_color = title_color | ||
|
||
# Search box border color | ||
searchbox_border_color = border_color | ||
|
||
# File position indicator color | ||
position_indicator_color = title_color | ||
|
||
# Menu box color | ||
menubox_color = dialog_color | ||
|
||
# Menu box border color | ||
menubox_border_color = border_color | ||
|
||
# Item color | ||
item_color = dialog_color | ||
|
||
# Selected item color | ||
item_selected_color = button_active_color | ||
|
||
# Tag color | ||
tag_color = title_color | ||
|
||
# Selected tag color | ||
tag_selected_color = button_label_active_color | ||
|
||
# Tag key color | ||
tag_key_color = button_key_inactive_color | ||
|
||
# Selected tag key color | ||
tag_key_selected_color = (RED,BLUE,ON) | ||
|
||
# Check box color | ||
check_color = dialog_color | ||
|
||
# Selected check box color | ||
check_selected_color = button_active_color | ||
|
||
# Up arrow color | ||
uarrow_color = (GREEN,WHITE,ON) | ||
|
||
# Down arrow color | ||
darrow_color = uarrow_color | ||
|
||
# Item help-text color | ||
itemhelp_color = (WHITE,BLACK,OFF) | ||
|
||
# Active form text color | ||
form_active_text_color = button_active_color | ||
|
||
# Form text color | ||
form_text_color = (WHITE,CYAN,ON) | ||
|
||
# Readonly form item color | ||
form_item_readonly_color = (CYAN,WHITE,ON) | ||
|
||
# Dialog box gauge color | ||
gauge_color = title_color | ||
|
||
# Dialog box border2 color | ||
border2_color = dialog_color | ||
|
||
# Input box border2 color | ||
inputbox_border2_color = dialog_color | ||
|
||
# Search box border2 color | ||
searchbox_border2_color = dialog_color | ||
|
||
# Menu box border2 color | ||
menubox_border2_color = dialog_color |
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 |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#!/data/data/com.termux/files/usr/bin/bash | ||
version="Beta 0.5v" | ||
#setterm -cursor off | ||
clear | ||
echo "Tools, version ${version} tool any inside while error code" | ||
sleep 3 | ||
|
||
# input nameapt informatiob ;; | ||
# input URL,namepackage information ;: | ||
# default value information functinos ;; | ||
# URL=""; namepackage=""; nameapt="" | ||
# Default screen startup = Function (dialogstart) Enable ;; | ||
|
||
# Source File Connection ;; | ||
terp="/data/data/com.termux/files" | ||
terps="/data/data/com.termux/files/home/Teros" | ||
bash_url="${terp}/usr/bin/bash" | ||
#bash_url="/bin/bash" | ||
colors_file="${terp}/home/SCD.conf" | ||
info_file="${terps}/info.sh" | ||
debian_source_file="${terps}/debian_source.sh" | ||
external_file="${terps}/external_start.sh" | ||
conf="${terps}/error_tool.conf" | ||
echo -e """ | ||
# Remove File use the (rm -rf ${conf}) command at any terminal linux Good Tool :) .... | ||
# WARNING : The setup program will re-create the file every time error are detected or the program restarts | ||
# Version ${version} interface in terminal ... | ||
\n\n..... List Error .....""" > ${conf} | ||
echo -e "\nPleasse, check file ${conf} after the exit tool\n" | ||
|
||
# Function exiting and error ;; | ||
|
||
exitf () { | ||
clear | ||
echo "Exiting ... Poragram stopping now ..." | ||
if [ $err -eq 0 ]; then | ||
echo "Normal Exit ..." | ||
else | ||
echo -e "Error, Ops A line has occurred in a number ($err)\nPlease Check File ${conf}" | ||
echo -e "Details of error : $des\nError number : $err\nFile name : $1" >> ${conf} | ||
fi | ||
echo "........ End ........" >> ${conf} | ||
exit 1 | ||
} | ||
|
||
# Functions check the required programs ;; | ||
|
||
Funcheck () { | ||
if ! [ -r "$bash_url" ] && [ -r "$terps" ]; then | ||
echo "Exiting ... Error I did not find a file bash or have not selected a valid path in termux :(" | ||
err=1; des="Path no termux : ($0) Teros ($terps) or not user account default termux"; exitf | ||
fi | ||
if ! [ -r "$info_file" ] && [ -r "$debian_source_file" ] && [ -r "$colors_file" ] && [ -r "$external_file" ]; then | ||
echo "Lack of files .. !!" && err=2; des="$(ls)\n$(pwd) \nLack of files .."; exitf | ||
else re=1 | ||
fi | ||
if ! [ -r $(which dialog) ] && [ -r $(which pv) ] && [ -r $(which wget) ] && [ -r $(which proot) ]; then | ||
echo "Download important programs ..." | ||
apt install dialog pv proot wget -y | ||
else ((re++)) | ||
fi | ||
if [ $re -eq 2 ];then | ||
echo "Found File ..." | ||
export DIALOGRC=${colors_file} | ||
source ${info_file} | ||
source ${debian_source_file} | ||
source ${external_file} | ||
fi | ||
} | ||
|
||
# Functions dialog screen wget ;; | ||
|
||
dialogwget () { | ||
Funcheck | ||
if [ $URL != "" ] && [ $namepackage != "" ]; then | ||
wget "$URL" 2>&1 | stdbusf -o0 awk '/[.] +[0-9][0-9]?[0-9]?%/ { print substr ($0,63,3) }' | \ | ||
dialog --backtitle "PAGE DOWNLOAD ...." --title "Download Packege" \ | ||
--gauge "Download Packege : $namepackage ...." 7 40 | ||
else | ||
dialog --backtitle "PAGE ERROR DOWNLOAD ...." --msgbox "Error, Ops .. !, selected link or name package, please check error file (${terp}/home/error_tool.conf)" 8 40 | ||
echo "Error download info package $namepackage\nURL = ${namepackage} is not correct url please try url download side web browser and agen download in tool me .. thank :)" >> ${conf} | ||
fi | ||
clear | ||
echo -e "\a\aExiting program now please wait for out program ..... " | ||
sleep 3 | ||
} | ||
|
||
# Functions dialog tar extraction install ;; | ||
|
||
dialogtar () { | ||
Funcheck | ||
if [ -r $filetar ]; then | ||
(pv -n $filetar | proot --link2symlink tar xf - -C target_directory ) 2>&1 | \ | ||
dialog --backtitle "PAGE TAR TOOL ...." --title "Extraction System Files $filetar ..." --gauge "Install Sustem, Please wait ..." 7 40 | ||
else | ||
dialog --backtitle "PAGE ERROR"--pause "I did not find the file, please try agin ...." 8 30 5 | ||
clear | ||
fi | ||
} | ||
|
||
# Function Start Screen Dialog Interface inside the terminal ;; | ||
|
||
dialogstart () { | ||
sleep 2 | ||
exec 3>&1 | ||
select_os=$(dialog \ | ||
--backtitle "PAGE SELECT OS INSTALL ..." \ | ||
--menu "Menu Select OS" 10 25 8 \ | ||
"1" "Debian OS" \ | ||
"2" "External Tools" \ | ||
"3" "Information" \ | ||
2>&1 1>&3) | ||
if [ $? -eq 1 ]; then echo -e "\nYou did not take any action :(\n" >> ${conf}; echo "Exiting .."; sleep 2; clear; fi | ||
exec 3>&- | ||
case "$select_os" in | ||
1) Fundebian ;; | ||
2) check_and_start; dialogstart ;; | ||
3) dialoginfo; dialogstart ;; | ||
esac | ||
} | ||
|
||
# Start Function name | ||
# { | ||
Funcheck | ||
#if [ "$Auto_start" == "yes" ]; then | ||
dialogstart | ||
#fi | ||
# } | ||
err=0; exitf | ||
# errall=2 | ||
#setterm -cursor on |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/data/data/com.termux/files/usr/bin/bash | ||
|
||
# Functions install Debian OS ;; | ||
|
||
Fundebian () { | ||
pn="$(pwd)" | ||
#cd "${terp}" | ||
folder=debian-fs | ||
tarball="debian-rootfs.tar.gz" | ||
if [ -d "$folder" ]; then | ||
first=1 | ||
echo "skipping downloading" | ||
fi | ||
if [ "$first" != 1 ]; then | ||
if [ ! -f $tarball ]; then | ||
case `dpkg --print-architecture` in | ||
aarch64) | ||
archurl="arm64" ;; | ||
arm) | ||
archurl="armhf" ;; | ||
amd64) | ||
archurl="amd64" ;; | ||
x86_64) | ||
archurl="amd64" ;; | ||
i*86) | ||
archurl="i386" ;; | ||
x86) | ||
archurl="i386" ;; | ||
*) | ||
err=3; des="unknown architecture"; echo "$des"; exitf ;; | ||
esac | ||
URL="https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Rootfs/Debian/${archurl}/debian-rootfs-${archurl}.tar.gz" -O $tarball | ||
namepackage="${tarball}" | ||
dialogwget | ||
fi | ||
cur=`pwd` | ||
mkdir -p "$folder" | ||
cd "$folder" | ||
filetar=${cur}/${tarball}||: | ||
dialogtar | ||
cd "$cur" | ||
fi | ||
mkdir -p debian-binds | ||
bin=start-debian.sh | ||
echo "writing launch script" | ||
cat > $bin <<- EOM | ||
#!/bin/bash | ||
cd \$(dirname \$0) | ||
## unset LD_PRELOAD in case termux-exec is installed | ||
unset LD_PRELOAD | ||
command="proot" | ||
command+=" --link2symlink" | ||
command+=" -0" | ||
command+=" -r $folder" | ||
if [ -n "\$(ls -A debian-binds)" ]; then | ||
for f in debian-binds/* ;do | ||
. \$f | ||
done | ||
fi | ||
command+=" -b /dev" | ||
command+=" -b /proc" | ||
command+=" -b debian-fs/tmp:/dev/shm" | ||
## uncomment the following line to have access to the home directory of termux | ||
#command+=" -b /data/data/com.termux/files/home:/root" | ||
## uncomment the following line to mount /sdcard directly to / | ||
#command+=" -b /sdcard" | ||
command+=" -w /root" | ||
command+=" /usr/bin/env -i" | ||
command+=" HOME=/root" | ||
command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games" | ||
command+=" TERM=\$TERM" | ||
command+=" LANG=C.UTF-8" | ||
command+=" /bin/bash --login" | ||
com="\$@" | ||
if [ -z "\$1" ]; then | ||
exec \$command | ||
else | ||
\$command -c "\$com" | ||
fi | ||
EOM | ||
|
||
echo "fixing shebang of $bin" | ||
termux-fix-shebang $bin | ||
echo "making $bin executable" | ||
chmod +x $bin | ||
echo "removing image for some space" | ||
dialog --backtitle "PAGE REMOVE ..." --msgbox "Remove ${tarball} ?" 8 30 | ||
if [ $? -eq 1 ];then | ||
rm ${tarball} | ||
fi | ||
dialog --backtitle "PAGE END ..." --infobox "You can now launch Debian with the ./${bin} script, and run scrpit command (bash GUI.sh) install" 10 30 | ||
clear | ||
./start-debian.sh | ||
} | ||
|
||
#errall=1 |
Oops, something went wrong.