save point
This commit is contained in:
parent
b63edea4a5
commit
bacf64dc22
6 changed files with 57 additions and 7014 deletions
27
check.bash
27
check.bash
|
@ -1,6 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
#set -x # debug mode
|
||||
|
||||
# This should work on a Debian based system, any of them
|
||||
# Requires makeslef and apt
|
||||
|
||||
# Some menu things
|
||||
|
||||
|
@ -35,7 +38,6 @@ function press_enter() {
|
|||
function copy_config() {
|
||||
cprint 2 "Copying config files..."
|
||||
sleep 1
|
||||
#cp -r /etc/ /tmp/
|
||||
# create a temp folder
|
||||
tmpdir=$(mktemp -d)
|
||||
echo $tmpdir
|
||||
|
@ -44,6 +46,22 @@ function copy_config() {
|
|||
# From https://wiki.debian.org/AptCLI#apt-file
|
||||
# dpkg --get-selections >/backup/package-selections
|
||||
# apt install $(cat /backup/package-selections | awk '{print $1}')
|
||||
arcdir=$(mktemp -d)
|
||||
echo $arcdir
|
||||
mkslf=$(which makeself.sh)
|
||||
echo $mkslf
|
||||
$mkslf --gzip $tmpdir $arcdir/restore.run "SFX archive for backup" echo "Extraction done"
|
||||
cprint 2 "Done!"
|
||||
}
|
||||
|
||||
function menu_option_two() {
|
||||
cprint 2 "Installing makeself..."
|
||||
sleep 1
|
||||
wget https://github.com/megastep/makeself/releases/download/release-2.5.0/makeself-2.5.0.run
|
||||
chmod +x makeself-2.5.0.run
|
||||
./makeself-2.5.0.run
|
||||
cd makeself-2.5.0
|
||||
cp *.sh /usr/bin
|
||||
cprint 2 "Done!"
|
||||
}
|
||||
|
||||
|
@ -51,13 +69,14 @@ function cleanup() {
|
|||
cprint 2 "Cleaning up..."
|
||||
sleep 1
|
||||
rm -rf $tmpdir
|
||||
rm -rf $arcdir
|
||||
}
|
||||
|
||||
# Check for root only important on pure Debian as there is no sudo by default
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
# check is the system is debian
|
||||
if [ -f /etc/debian_version ]; then
|
||||
cprint 3 "Notice: This script may need to be run as root on Debian, especially if its a stock install" ; press_enter ;
|
||||
cprint 3 "Notice: This script may need to be run as root on Debian, especially if its a stock install. Also requires makeself to created a distributable self restorable package" ; press_enter ;
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -65,8 +84,8 @@ until [ "$selection" = "0" ]; do
|
|||
clear
|
||||
echo ""
|
||||
cprint 3 " Main Menu"
|
||||
mprint 1 "Copy the system config"
|
||||
mprint 2 "Restore the system config"
|
||||
mprint 1 "Create a self restorable package"
|
||||
mprint 2 "Install makeself(required) to create self restorable package"
|
||||
mprint 0 "Exit"
|
||||
echo ""
|
||||
echo -n " Enter selection: "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue