Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWatcherMultiversal authored Aug 17, 2022
1 parent c1a8779 commit dcbaecf
Show file tree
Hide file tree
Showing 25 changed files with 1,628 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# This script lists the backups.
# Only modify the source code if you know what you are doing.

# Developed by: Angel Gabriel Mortera Gual.
# Github: https://github.com/TheWatcherMultiversal/Veapysh


echo ""; echo -e "System backups:"
BACKUPS=`ls /etc/veapysh/Backups/`
for i in $BACKUPS; do
echo -e "Backup in:" "\e[32m$i\e[0m"
done
echo ""

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# This script will test the system to create the backup.
# Only modify the source code if you know what you are doing.

# Developed by: Angel Gabriel Mortera Gual.
# Github: https://github.com/TheWatcherMultiversal/Veapysh

# Checking if the backup script exists.

clear
if [ -f /etc/init.d/veapysh-generatorbackups ]; then

i=0
while [ $i -lt 1 ]; do
echo "There is already a script for backups."
echo "Do you want to create a new script?"
echo ""; echo 'Type "y" to create a new script.'
echo 'Type "n" to ignore this message.'
echo 'Type "x" to kill the running backup script.'

read OPTION_A
case "$OPTION_A" in
y|Y)
echo ""; echo "Creating new script..."
sudo update-rc.d veapysh-generatorbackups remove
sudo rm /etc/init.d/veapysh-generatorbackups
echo "`date +%b | tr 'a-z' 'A-Z' | cut -c1``date +%b | cut -c2-3` `date +%d` `date +%X` `whoami` `id -g -n`: Veapysh backup script disabled" >> /var/log/veapysh.log
sleep 2s
sudo python3 /etc/veapysh/Configuration/s1/backup_script.py
i=1
;;
n|N)
echo ""; i=1
;;
x|X)
sudo update-rc.d veapysh-generatorbackups remove
sudo rm /etc/init.d/veapysh-generatorbackups
echo "`date +%b | tr 'a-z' 'A-Z' | cut -c1``date +%b | cut -c2-3` `date +%d` `date +%X` `whoami` `id -g -n`: Veapysh backup script disabled" >> /var/log/veapysh.log
echo""; echo "The script has been removed."
sleep 2s
i=1
;;
*)
echo ""
esac
done
else
I=0
while [ $I -lt 1 ]; do
echo "Are you sure to create the script for the backups? [Y/n]"; read OPTION_B
case "$OPTION_B" in
y|Y)
echo ""; sudo python3 /etc/veapysh/Configuration/s1/backup_script.py
I=1
;;
n|N)
echo ""; I=1
;;
*)
echo ""
esac
done
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#!/usr/bin/python3

# Veapysh is a terminal utility to manage basic scripts
# in an easy and intuitive way for the user.

# Only modify the source code if you know what you are doing.

# Developed by: Angel Gabriel Mortera Gual.
# Github: https://github.com/TheWatcherMultiversal/Veapysh

import subprocess
import time

from colorama import Fore, init
init()

def app():

# This section belongs to the Veapysh options menu.

question = True

while question:

subprocess.run("clear", shell=True)
print(Fore.GREEN + "\r\nVeapysh" + Fore.CYAN + " is a terminal utility to manage your Linux system with automated scripts.\r\n")
print(Fore.YELLOW +"Developed by:" + Fore.RESET + " Angel Gabriel Mortera Gual.")
print(Fore.YELLOW +"Project link:" + Fore.RESET + " link\r\n")

print(Fore.RESET + " a) System backup.")
print(" b) System updater.")
print(" c) View active scripts.")
print(" d) Restore system with backup.")
print(" e) More.")
print(" f) Exit.")

opc_0 = input("\r\nSelect an option [a/b/c/d/e/f] ")

if opc_0 == "a":
print(Fore.GREEN + "\r\nGenerate backup script...\r\n" + Fore.RESET)
time.sleep(2)
subprocess.run("sudo /etc/veapysh/Configuration/veapysh_backup.sh", shell=True)
print("Finished process...")
time.sleep(2)

elif opc_0 == "b":
print(Fore.GREEN + "\r\nGenerate upgrade script...\r\n" + Fore.RESET)
time.sleep(2)
subprocess.run("sudo /etc/veapysh/Configuration/veapysh_upgrade.sh", shell=True)
print("Finished process...")
time.sleep(2)

elif opc_0 == "c":
subprocess.run("sudo /etc/veapysh/Configuration/veapysh_viewprocess.sh", shell=True)
print("Finished process...")
time.sleep(2)

elif opc_0 == "d":
question_2 = True
while question_2:
subprocess.run("clear", shell=True)
print(Fore.CYAN + "\r\nFirst choose the hard drive you want to restore. Press")
print("\"q\" to cancel the process.\r\n")
print(Fore.YELLOW +"Example:" + Fore.RESET + " sda1\r\n")
print(Fore.GREEN + "More info:" + Fore.RESET + " https://tldp.org/LDP/sag/html/partitions.html \r\n")
subprocess.run("df | head -1", shell=True)
subprocess.run("df | grep sd; echo ''", shell=True)
opc_0_a = input("Type the hard drive to restore: ")

if opc_0_a == "q":
question_2 = False

else:
print(Fore.GREEN + "\r\nSaving info :)" + Fore.RESET)
time.sleep(2)
question_2_1 = True
while question_2_1:
subprocess.run("clear", shell=True)
print(Fore.CYAN + "\r\nChoose the backup to restore the system. Press \"q\" to cancel process. ")
print("If you do not see any files, it is because a backup has not")
print("yet been generated\r\n")
print(Fore.YELLOW +"Example:" + Fore.RESET + " sdabackup.img.bz2\r\n")
print(Fore.GREEN + "More info:" + Fore.RESET + " https://www.geeksforgeeks.org/dd-command-linux/")
subprocess.run("sudo /etc/veapysh/Configuration/s1/list_backups.sh", shell=True)
opc_0_b = input("Select backup file: ")

if opc_0_b == "q":
question_2_1 = False

else:
print(Fore.GREEN + "\r\nRestoring the \"sda\" disk drive, do not turn off your device.\r\n" + Fore.RESET)
time.sleep(2)
command_bunzip2 = "sudo bunzip2 /etc/veapysh/Backups/" + opc_0_b
subprocess.run(command_bunzip2, shell=True)
file_restore = ""
num = len(opc_0_b) - 4

for i in range(0, num):
file_restore += opc_0_b[i]

command_restore = "dd if=/etc/veapysh/Backups/" + file_restore + " of=/dev/" + opc_0_a
subprocess.run(command_restore, shell=True)
command_bz2 = "sudo bzip2 /etc/veapysh/Backups/" + file_restore
subprocess.run(command_bz2, shell=True)
print(Fore.GREEN + "Process completed successfully" + Fore.RESET)
time.sleep(4)
question_2_1 = False

elif opc_0 == "e":
question_2 = True
while question_2:

subprocess.run("clear", shell=True)
print(Fore.GREEN + "\r\nVeapysh" + Fore.CYAN + " is a terminal utility to manage your Linux system with automated scripts.\r\n")
print(Fore.YELLOW +"Developed by:" + Fore.RESET + " Angel Gabriel Mortera Gual.")
print(Fore.YELLOW +"Project link:" + Fore.RESET + " link\r\n")

print(Fore.RESET + " a) About.")
print(" b) Man page.")
print(" c) <-- To return.")
opc_0_1 = input("\r\nSelect an option [a/b/c] ")

if opc_0_1 == "a":

subprocess.run("clear", shell=True)
print(Fore.GREEN + "Veapysh" + Fore.CYAN + " is a terminal utility for managing automatic system scripts in an")
print("easy and end-user friendly way.\r\n")
time.sleep(3)
# Information about the project.
print(Fore.YELLOW +"License:" + Fore.RESET + " GNU General Public License v2.0")
time.sleep(3)
print(Fore.YELLOW +"Developed by:" + Fore.RESET + " Angel Gabriel Mortera Gual")
time.sleep(3)
print(Fore.YELLOW +"My Github:" + Fore.RESET + " https://github.com/TheWatcherMultiversal\r\n")
time.sleep(3)
print(Fore.YELLOW +"Contributors:" + Fore.RESET)
# Here add your name if you are a contributor to the project :)
print("- Emir Pérez Martinez")
time.sleep(4)

elif opc_0_1 == "b":
subprocess.run("man veapysh", shell=True)

elif opc_0_1 == "c":
question_2 = False

else:
print(Fore.RED + "\r\nWrong value!!!\r\n" + Fore.RESET)
time.sleep(1)

elif opc_0 == "f":
subprocess.run("clear", shell=True)
question = False
exit

else:
print(Fore.RED + "\r\nWrong value!!!\r\n" + Fore.RESET)
time.sleep(1)

app()
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Usage: veapysh [Options]
Makes use of Veapysh utilities.

Call the utilities available from Veapysh for simple, easy
and end-user friendly automatic script management.

Options:
-l, --list List active scripts.
-h, --help Prints help.
-v, --version Prints version.

For more information or help, visit the project page.
<https://github.com/TheWatcherMultiversal/Veapysh>
Report bugs in this email.
<universepenguin@protonmail.com>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# This script is responsible for checking the existing upgrade script.
# Only modify the source code if you know what you are doing.

# Developed by: Angel Gabriel Mortera Gual.
# Github: https://github.com/TheWatcherMultiversal/Veapysh

# Checking if the system upgrade script exists.

clear
if [ -f /etc/init.d/veapysh-generatorupgrades ]; then

i=0
while [ $i -lt 1 ]; do
echo "There is already a script to upgrade the system."
echo "Do you want to create a new script?"
echo ""; echo 'Type "y" to create a new script.'
echo 'Type "n" to ignore this message.'
echo 'Type "x" to kill the running upgrade script.'

read OPTION_A
case "$OPTION_A" in
y|Y)
echo ""; echo "Creating new script..."
sudo update-rc.d veapysh-generatorupgrades remove
sudo rm /etc/init.d/veapysh-generatorupgrades
echo "`date +%b | tr 'a-z' 'A-Z' | cut -c1``date +%b | cut -c2-3` `date +%d` `date +%X` `whoami` `id -g -n`:: Veapysh upgrade script disabled" >> /var/log/veapysh.log
sleep 2s
sudo python3 /etc/veapysh/Configuration/s2/upgrade_script.py
i=1
;;
n|N)
echo ""; i=1
;;
x|X)
sudo update-rc.d veapysh-generatorupgrades remove
sudo rm /etc/init.d/veapysh-generatorupgrades
echo "`date +%b | tr 'a-z' 'A-Z' | cut -c1``date +%b | cut -c2-3` `date +%d` `date +%X` `whoami` `id -g -n`: Veapysh upgrade script disabled" >> /var/log/veapysh.log
echo""; echo "The script has been removed."
sleep 2s
i=1
;;
*)
echo ""
esac
done
else
I=0
while [ $I -lt 1 ]; do
echo "Are you sure you create the script for system upgrades? [Y/n]"; read OPTION_B
case "$OPTION_B" in
y|Y)
echo ""; sudo python3 /etc/veapysh/Configuration/s2/upgrade_script.py
I=1
;;
n|N)
echo ""; I=1
;;
*)
echo ""
esac
done
fi

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Only modify the source code if you know what you are doing.

# Developed by: Angel Gabriel Mortera Gual.
# Github: https://github.com/TheWatcherMultiversal/Veapysh

echo ""
echo 'Script: Status:'
if [ -f /etc/init.d/veapysh-generatorbackups ]; then
echo "veapysh-generatorbackups" " (\e[32mEnabled\e[0m)"
else
echo "veapysh-generatorbackups" " (\e[31mDisabled\e[0m)"
fi

if [ -f /etc/init.d/veapysh-generatorupgrades ]; then
echo "veapysh-generatorupgrades" " (\e[32mEnabled\e[0m)"
else
echo "veapysh-generatorupgrades" " (\e[31mDisabled\e[0m)"
fi

case $1 in
-l)
echo ""
;;
*)
echo ""; echo "Press" "\e[32mENTER\e[0m" " to finish the process."

i=1
read OPX
while [ "$i" = "1" ]; do
case "$OPX" in
*)
i=0
esac
done
esac
27 changes: 27 additions & 0 deletions Sources/Debian/Veapysh_stable-release_1.0.1_/sbin/veapysh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Veapysh: is a terminal utility available on Linux systems for automated administration of basic scripts.
# License: GNU General Public License v2.0
# Developed by: Angel Gabriel Mortera Gual
# Github project: https://github.com/TheWatcherMultiversal/Veapysh

# Options
VERSION_VP="Veapysh v1.0.0"

set -e

case "$1" in
-h|--help)
cat /etc/veapysh/Configuration/veapysh_help.txt
;;
-l|--list)
sh /usr/share/veapysh/veapysh-requeriments.sh
sudo /etc/veapysh/Configuration/veapysh_viewprocess.sh -l
;;
-v|--version)
echo "$VERSION_VP"
;;
*)
sh /usr/share/veapysh/veapysh-requeriments.sh
sudo python3 /etc/veapysh/Configuration/veapysh_configuration.py
esac
Loading

0 comments on commit dcbaecf

Please sign in to comment.