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 Wed 26 Nov 2014, 12:17
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 Posts_count  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 818
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

Edited_time_total
Back to top
View user's profile Send_private_message 
stu91


Joined: 06 Aug 2012
Posts: 145
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: 818
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: 818
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: 2579
Location: www.eussenheim.de/

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: 818
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: 145
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: 818
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: 2579
Location: www.eussenheim.de/

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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0649s ][ Queries: 12 (0.0077s) ][ GZIP on ]