Jump to content

Photo

efix.sh


  • Please log in to reply
3 replies to this topic

#1 hippytaff

hippytaff

    Member

  • Members
  • 1269 posts
  • LocationWales, UK

Posted 16 January 2012 - 10:00 PM

I did this for fun. Thought it might come in handy. It's a script to backup ~/.e so that e is regenerated when updates kill e. If that makes sense :/

If you run the script with no arguments, it will automatically back ~/.e to ~/.e_bkup. To run it open a terminal in the diretory it is in
./efix.sh

You can use the following flags for further options -
./efix.sh -s

or

./efix.sh --suppress

to remove ~/.e and restart E without backing up first.

./efix.sh -b

or

./efix.sh --backup

To backup ~/.e without removing it.

Simple script. Some people might find it useful. As always see -h or --help for..well help (which will basically say what I just said)

Cheers
Hippytaff

#!/bin/bash

#################################################
#   Fix .e post Enlightenment update .e death   #
# License: WTFPL :see http://sam.zoy.org/wtfpl/ #
#  Comes with absolutely no warranty yada yada  #
#                Hippytaff			#
#################################################

function call_parse_cli
{
	if [ -z "$1" ]
	then
	call_backup
	call_fix

	elif [ "$1" == "-h" ]||[ "$1" == "--help" ]
	then
	call_help

	elif [ "$1" == "-s" ]||[ "$1" == "--supress" ]
	then
	call_fix

	elif [ "$1" == "-b" ]||[ "$1" == "--backup" ]
	then
	call_backup

	else

	echo "invalid argument."
	echo "see --help "
	fi
	exit 1
}

function call_help
{
echo
echo "		~/.e is backed up as ~/.e_bkup by default"
echo "		regenerate e without backing up...-s or --supress"
echo "		backup without regenerating .e....-b or --backup"
echo
}

function call_backup
{
	cp -r ~/.e ~/.e_bkup
	echo "Backing up ~/.e to ~/.e_bkup"
	echo

}

function call_fix
{
rm -r ~/.e
enlightenment_remote -restart 
}

call_parse_cli "$1"

Copy and paste to a text editor and save as efix.sh (for the instructions and --help to make sense). Make the file executable...away to go :)

Hippytaff - Trying to understand stuff since 1979




A big thank you to everyone who contributes to Bodhi Linux


#2 STRUPPI

STRUPPI

    Member

  • Members
  • 738 posts

Posted 16 January 2012 - 10:57 PM

Hi hippytaff,
nois good, very good, your script.

It is OK for you if I include for me 'dialog' in your script?

I like grafik-Apps, so too in terminal with select, make/set marker or unset, press final ENTER and let run the script.

#3 aeonius

aeonius

    Lord of the Website

  • Administrators
  • 2644 posts
  • LocationThe Netherlands

Posted 16 January 2012 - 10:59 PM

Great post, hippy!

#4 hippytaff

hippytaff

    Member

  • Members
  • 1269 posts
  • LocationWales, UK

Posted 16 January 2012 - 11:00 PM

Thanks and go ahead Struppi - do with it as you will :)

Hippytaff - Trying to understand stuff since 1979





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users