Part of GO Script not executing


Recommended Posts

I have had this issue for many years, google it, could not find the solution, left it for a bit, google it....

But I do want to get to the bottom of this issue now. I have added some things to my /config/go script to load config files for midnight commander and a few other settings. I understand I cannot copy to the array at hat point, but in this case I only copy from my flash drive to the OS file system. I am convinced this is used to work many years ago. Here is the script:

#!/bin/bash
# Start the Management Utility

#MC panels config
cp /boot/JFDpersist/ini /root/.config/mc/ini
cp /boot/JFDpersist/panels.ini /root/.config/mc/panels.ini
cp /boot/JFDpersist/mcc /usr/local/sbin

# SSH Keys
mkdir ~/.ssh
cp /boot/JFDpersist/authorized_keys ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

/usr/local/sbin/emhttp &

 

None of my commands execute in this script. Is there a new better ways to get things copied around at boot? If not, what am I doing wrong?

Thanks!

Link to comment

What has drawn you to that conclusion?   Are you saying that the WebGUI is not loading?   That is done by the last line of the script you quote so if the GUI loading the ‘go’ file IS being executed and the problem is with the extra commands you have added.

 

Have you tried executing each of the commands in turn from a console session?

 

 I can see an immediate problem with the line:

16 minutes ago, Raidersan said:

cp /boot/JFDpersist/mcc /usr/local/sbin

as this copies ‘mcc’ to /user/local/bin but does not then give it execute permission (files on the flash drive cannot have execute permission for security reasons).

Link to comment

Hey, thanks for the help!

emhttp does load, my mistake. 

my .ssh files are not copied and I need to login manually after each reboot. 

Is this still the best way to get files copied post boot? I would have like to see a more elegant integration in the web interface to do all those tasks, especially the standard copy of config files from flash to the OS file system that most ppl have to do.

Link to comment

You can normally use the User Scripts plugin to do such copies as long as you do not require them to happen before the array is started.   Still requires a script but easier to maintain.    The Config file Editor plugin is another alternative that allows editing of any Unraid configuration files from within the GUI.

 

The handling of ssh keys no longer requires manual copying of the key files - you just have to place them in the correct location on the flash drive in the config/ssh folder.

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.