(SOLVED) Help with my Go script


Recommended Posts

Hi Guys,

 

I have been trying to activate both Maraschino and Heaphones to start from my "go" script without any luck. I also NEVER been able to get the unMenu packages for the applications to work. Below is my go script. The are the ones that do not start...

 

  python /mnt/cache/.custom/headphones/Headphones.py -d -p 8091
  nohup python /mnt/cache/.custom/maraschino/Maraschino.py &

 

 

Here is my full go script:

 


#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &


#Hernando added below

sleep 30
for i in /dev/md*
do
    blockdev --setra 2048 $i
done

echo nameserver 192.168.0.1 >/etc/resolv.conf
echo 192.168.0.201 tower >>/etc/hosts/boot/unmenu/uu

cd /boot/packages && find . -name '*.auto_install' -type f -print | sort | xargs -n1 sh -c 
python /mnt/cache/.custom/headphones/Headphones.py -d -p 8091
# determine if cache drive online, retry upto 7 times
for i in 0 1 2 3 4 5 6 7
do
    if [ ! -d /mnt/cache ]
    then
      sleep 10
    fi
done

# If Cache drive is online, start SABNzbd
if [ -d /mnt/cache ]; then
   Start SABnzbd and sickbeard
  installpkg /boot/custom/SABnzbdDependencies-1.3-i486-unRAID.tgz
  python /mnt/cache/.custom/sabnzbd/SABnzbd.py -d -s 192.168.0.201:88
  nohup python /mnt/cache/.custom/maraschino/Maraschino.py &
  nohup python /mnt/cache/.custom/sickbeard/SickBeard.py &
  python /mnt/cache/.custom/headphones/Headphones.py -d -p 8091

beep -f660 -l100ms -D 130ms
beep -f660 -l100ms -D 170ms
beep -f660 -l100ms -D 150ms
beep -f510 -l100ms -D 80ms
beep -f660 -l100ms -D 150ms
beep -f770 -l100ms -D 275ms
beep -f380 -l100ms -D 575ms
beep -f660 -l100ms -D 130ms
beep -f660 -l100ms -D 170ms
beep -f660 -l100ms -D 150ms
beep -f510 -l100ms -D 80ms
beep -f660 -l100ms -D 150ms
beep -f770 -l100ms -D 275ms
beep -f380 -l100ms -D 575ms
fi

/boot/unmenu/uu

cp --remove-destination /boot/custom/par2 /usr/bin
cp /boot/custom/libtbb.so /usr/bin
cp /boot/custom/libtbb.so.2 /usr/bin

sleep 2
beep -f 700 ; beep -f 500 ; beep -f 700 ; beep -f 500
beep -f 700 ; beep -f 500 ; beep -f 700 ; beep -f 500

 

Whenever I type each of the lines individually at the command line, they execute and start the application properly. I want to be able to get these to start automatically. Can anyone offer some advice please?

 

Many thanks,

 

Hernando

 

ps I am using unRAID 4.7

Link to comment

To start with.  This

echo 192.168.0.201 tower >>/etc/hosts/boot/unmenu/uu

 

should be on two lines

echo 192.168.0.201 tower >>/etc/hosts

/boot/unmenu/uu

 

the line like this further in the go script can be removed, as it will just try to start unmenu a second time.

 

This is not needed at all unless you are on pre 4.0 versions of unRAID

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

 

I have no idea what these do, but shared libraries typically go in /lib or /usr/lib, not in /bin

cp /boot/custom/libtbb.so /usr/bin

cp /boot/custom/libtbb.so.2 /usr/bin

 

I did not see you install python before invoking this line:

python /mnt/cache/.custom/headphones/Headphones.py -d -p 8091

and

When unRAID starts, it may not have any idea where you installed python, so you might need a full path here

/full/path/to/python /mnt/cache/.custom/headphones/Headphones.py -d -p 8091

  nohup /full/path/to/python /mnt/cache/.custom/maraschino/Maraschino.py &

 

 

Link to comment

Hi Joe,

 

Thank you for the corrections to my go script. I have made the fixes you recommended.

 

Unfortunately, as far as the python startup for Headphones and Maraschino, they did not work. the line reads:

 

/usr/bin/python /mnt/cache/.custom/headphones/Heaphones.py -d -p 8091 

 

It did not start the service.... I go to my browser and go to tower:8091 or 192.168.0.201:8081 and I get the "url not found" message. If I type the same thing in a Putty terminal screen, it works.

 

At the moment I am only testing it with Heaphones... Is there anything else you can recommend?

 

Can I create some script that auto starts everytime unRAID boots? This would be independent of the go script.

 

Many thanks again,

 

H.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.