How can I improve this uninstall script? SOLVED

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

How can I improve this uninstall script? SOLVED

#1 Post by oldyeller »

Hello Everyone,

I have this uninstall script and I would like to improve on it.

Code: Select all

#!/bin/sh

Xdialog -title="Uninstalling" --yesno "Do you really want to Remove Believe?" 0 0
if [ $? -eq 0 ]; then
  rm -f /usr/local/bin/Believe
  rm -r /usr/local/Manna/Believe
  rm -f /usr/local/bin/rmBelieve
fi
What I would like to do is be able to remove this entry in fluxbox menu;

Code: Select all

[exec] (Believe) {Believe}
The menu is customize. Just not sure on how to code it. If this can't be done by the script. Than have it open the menu.base for manual editing.

Any help would be great.

Thanks
Last edited by oldyeller on Thu 02 May 2013, 16:12, edited 1 time in total.

User avatar
stu91
Posts: 145
Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501

#2 Post by stu91 »

Maybe?

Code: Select all

sed -i '/Believe/d' /menu/file

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#3 Post by oldyeller »

stu91 wrote:Maybe?

Code: Select all

sed -i '/Believe/d' /menu/file
Will give it a try.

I did figure out how to have the script open a window that states were to delete the line in the menu.base and than open up the menu.base.

This is the code that I added and I figured out how to do my first Xdialog I will have to finish this I am on the wrong puppy :lol: :lol:


EDIT:: Now I am on the right puppy :D

Code: Select all

Xdialog -title="Deleting" --msgbox "Delete line 44 in menu.base, after deleting hit refresh in the menu under settings-fluxbox" 0 0

exec geany /root/.fluxbox/menu.base

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#4 Post by oldyeller »

stu91 wrote:Maybe?

Code: Select all

sed -i '/Believe/d' /menu/file
This did not work.

Thanks

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#5 Post by L18L »

Code: Select all

sed -i '/Believe/d' $HOME/.fluxbox/menu.base
should delete every line containing Believe in /root/.fluxbox/menu.base

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#6 Post by oldyeller »

L18L wrote:

Code: Select all

sed -i '/Believe/d' $HOME/.fluxbox/menu.base
should delete every line containing Believe in /root/.fluxbox/menu.base
This did the trick :D

Thanks L18L

User avatar
stu91
Posts: 145
Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501

#7 Post by stu91 »

oldyeller wrote:
stu91 wrote:Maybe?

Code: Select all

sed -i '/Believe/d' /menu/file
This did not work.

Thanks
As L18L points out make sure it points to where ever the fluxbox menu file is located, the -i flag is edit in place.

could also use:

Code: Select all

grep -v  'Believe' /menu/file > /tmp/menu/file
rm -f /menu/file && mv -f /tmp/menu/file /menu/file
grep none matching string lines and send to new /tmp/menu/file - remove old /menu/file and move new /tmp/menu/file to its place.

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#8 Post by oldyeller »

Hi stu91,

Thanks will take a look at this as well


Cheers

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#9 Post by L18L »

Hi stu91,

did not know this
grep -v ...............
before
thank you :)

Post Reply