(solved) pinstall.sh syntax problem

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
Stripe
Posts: 658
Joined: Wed 23 Jun 2010, 05:18
Location: In a field. England

(solved) pinstall.sh syntax problem

#1 Post by Stripe »

Hi all

This is the first time I have built a pet that included pinstall.sh and puninstall.sh

I am trying to rename 2 files (for back up) and install another two files in their place

this is what the pinstall.sh looks like now (esac has been removed) and the actual file was not commented out.

Code: Select all

#!/bin/sh
mv /etc/xdg/templates/_root_.jwmrc /etc/xdg/templates/_root_.jwmrc1
mv /root/.jwmrc  /root/.jwmrc1
jwm -restart
the commands work great by themselves but do not work when run in this file, any ideas before I pull the rest of my hair out :lol:

cheers

Don
Last edited by Stripe on Sun 23 Oct 2011, 13:48, edited 3 times in total.

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#2 Post by big_bass »

Hey Stripe

you dont have a case

Code: Select all

#esac 
to use the end case which is esac

I dont know about the rest if it works but that
jumps out

Joe
Last edited by big_bass on Fri 21 Oct 2011, 13:06, edited 1 time in total.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

It stands out even more that every line is commented... Try this:

Code: Select all

#!/bin/sh 
mv /etc/xdg/templates/_root_.jwmrc /etc/xdg/templates/_root_.jwmrc1 
mv /root/.jwmrc /root/.jwmrc1 
jwm -restart

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#4 Post by seaside »

Stripe,

I'm not sure how this script is failing (if it's now as listed)
but some other possible problems might be that "/etc/xdg/templates/_root_.jwmrc" usually overides "/root/.jwmrc" and you have restarted jwm and it gets restarted again on pet install.

Cheers,
s

Stripe
Posts: 658
Joined: Wed 23 Jun 2010, 05:18
Location: In a field. England

#5 Post by Stripe »

hi all

thanks for the help

the code is now:

Code: Select all

#!/bin/sh
mv /etc/xdg/templates/_root_.jwmrc /etc/xdg/templates/_root_.jwmrc1
mv /root/.jwmrc /root/.jwmrc1 
and seems to be working, but I think now the replacement pet files I am installing are been changed and not the originals I want to save, so I will need to run pinstall first before the pet files are installed.
so that it renames the files I want renamed before the replacements are installed (any ideas?)

thanks again for the help (I am getting closer to making it work)

don

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#6 Post by 01micko »

Stripe

What about installing to a temp dir, backing up, then moving the stuff in the temp dir where it's supposed to go :wink:
Puppy Linux Blog - contact me for access

Stripe
Posts: 658
Joined: Wed 23 Jun 2010, 05:18
Location: In a field. England

#7 Post by Stripe »

thanks mick

thats the job sorted

cheers

don

Post Reply