Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 17 Apr 2014, 11:21
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How can I improve this uninstall script? SOLVED
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

PostPosted: Wed 01 May 2013, 20:47    Post subject:  How can I improve this uninstall script? SOLVED  

Hello Everyone,

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

Code:

#!/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:

[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, 12:12; edited 1 time in total
Back to top
View user's profile Send private message 
stu91


Joined: 06 Aug 2012
Posts: 144
Location: England. Dpup. Dell Inspiron 1501

PostPosted: Wed 01 May 2013, 23:56    Post subject:  

Maybe?
Code:
sed -i '/Believe/d' /menu/file
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

PostPosted: Thu 02 May 2013, 11:26    Post subject:  

stu91 wrote:
Maybe?
Code:
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 Laughing Laughing


EDIT:: Now I am on the right puppy Very Happy

Code:

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
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

PostPosted: Thu 02 May 2013, 11:43    Post subject:  

stu91 wrote:
Maybe?
Code:
sed -i '/Believe/d' /menu/file


This did not work.

Thanks
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2473
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Thu 02 May 2013, 11:56    Post subject:  

Code:
sed -i '/Believe/d' $HOME/.fluxbox/menu.base

should delete every line containing Believe in /root/.fluxbox/menu.base
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

PostPosted: Thu 02 May 2013, 12:12    Post subject:  

L18L wrote:
Code:
sed -i '/Believe/d' $HOME/.fluxbox/menu.base

should delete every line containing Believe in /root/.fluxbox/menu.base


This did the trick Very Happy

Thanks L18L
Back to top
View user's profile Send private message 
stu91


Joined: 06 Aug 2012
Posts: 144
Location: England. Dpup. Dell Inspiron 1501

PostPosted: Thu 02 May 2013, 12:13    Post subject:  

oldyeller wrote:
stu91 wrote:
Maybe?
Code:
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:
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.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 720
Location: Mishawaka IN

PostPosted: Thu 02 May 2013, 12:20    Post subject:  

Hi stu91,

Thanks will take a look at this as well


Cheers
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2473
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Thu 02 May 2013, 12:38    Post subject:  

Hi stu91,

did not know this
grep -v ...............
before
thank you Smile
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0536s ][ Queries: 11 (0.0030s) ][ GZIP on ]