Check my upstart script code?

John Hupp lubuntu at prpcompany.com
Sat May 9 15:21:39 UTC 2015


Here is the script code from an upstart job I'm trying to get working 
(but which doesn't work yet):

     # test for a fat client:
     if [[ $(hostname | grep 'ltsp') == ltsp* ]]; then
         sed 's/mount_removable=0/mount_removable=1/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     # test for a thin client:
     elif [ -n "$LTSP_CLIENT" ]; then
         sed 's/mount_removable=1/mount_removable=0/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     # machine must be the server
     else
         sed 's/mount_removable=0/mount_removable=1/' 
<~/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >~/.config/pcmanfm/lubuntu/pcmanfm.conf
     fi

Assuming that it was tripping on ~, I also tried:

     # test for a fat client:
     if [[ $(hostname | grep 'ltsp') == ltsp* ]]; then
         sed 's/mount_removable=0/mount_removable=1/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     # test for a thin client:
     elif [ -n "$LTSP_CLIENT" ]; then
         sed 's/mount_removable=1/mount_removable=0/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     # machine must be the server
     else
         sed 's/mount_removable=0/mount_removable=1/' 
<$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf 
 >$HOME/.config/pcmanfm/lubuntu/pcmanfm.conf
     fi

I'm guessing that my file identification strings need fixing up, but I'm 
such a poor scripter that this could only be one of several mistakes.

Check my homework?



More information about the Lubuntu-users mailing list