Page 1 of 1

Nas4free custom webgui

Posted: 10 Jun 2014 08:13
by chachi420
Hello everyone,
Why is it that when i customize a php page of the webgui and save it, it works well till i restart my nas. Simply restarting nas reverts all the changes back. How do i keep the changes?
Thank you for your help.

Re: Nas4free custom webgui

Posted: 10 Jun 2014 09:01
by b0ssman
you have the embedded install.

all system files are in a ram disk which doesn't get saved to the file system.
so upon a restart all changes are lost.

two possible solutions.
do a full install
or
create a postinit script
http://wiki.nas4free.org/doku.php?id=do ... nd_scripts
that copies the files at every boot.

Re: Nas4free custom webgui

Posted: 10 Jun 2014 10:59
by chachi420
b0ssman wrote:you have the embedded install.

all system files are in a ram disk which doesn't get saved to the file system.
so upon a restart all changes are lost.

two possible solutions.
do a full install
or
create a postinit script
http://wiki.nas4free.org/doku.php?id=do ... nd_scripts
that copies the files at every boot.
Hello b0ssman,
thank you for your reply. I have read about postinit scripts before but i have no idea how to write one. For example, let's say that i have modified the file "status_disk.php" with a code that shows temperature of disks that's above 30 in red color. How do i use that postinit scripts to make sure that file always has the code when i restart the nas?

Re: Nas4free custom webgui

Posted: 10 Jun 2014 11:19
by crowi
Hi chachi420,

you can also use crest's extended gui, this shows the temperatures already in different and much more:
viewtopic.php?f=71&t=6405

Re: Nas4free custom webgui

Posted: 10 Jun 2014 11:31
by chachi420
crowi wrote:Hi chachi420,

you can also use crest's extended gui, this shows the temperatures already in different and much more:
viewtopic.php?f=71&t=6405
Hey crowi,
Yes i have seen this wonderful extension and was thinking about implementing it as soon as i can but till then i wanted to keep learning all these different things so is there a way you can teach me how to create some sort of extension like that to be able to make a fix page like this?

Re: Nas4free custom webgui

Posted: 10 Jun 2014 12:02
by crowi
is there a way you can teach me how to create some sort of extension like that to be able to make a fix page like this
Sorry, no, I am not good at php, you need to ask crest or one of the developers :)

Re: Nas4free custom webgui

Posted: 10 Jun 2014 12:07
by b0ssman
chachi420 wrote: Hello b0ssman,
thank you for your reply. I have read about postinit scripts before but i have no idea how to write one. For example, let's say that i have modified the file "status_disk.php" with a code that shows temperature of disks that's above 30 in red color. How do i use that postinit scripts to make sure that file always has the code when i restart the nas?

just execute the command that copies your file over the old one

cp /mnt/<disk>/file.php /<locaiton of the other file/file.php

Re: Nas4free custom webgui

Posted: 10 Jun 2014 14:32
by chachi420
b0ssman wrote:
chachi420 wrote: Hello b0ssman,
thank you for your reply. I have read about postinit scripts before but i have no idea how to write one. For example, let's say that i have modified the file "status_disk.php" with a code that shows temperature of disks that's above 30 in red color. How do i use that postinit scripts to make sure that file always has the code when i restart the nas?

just execute the command that copies your file over the old one

cp /mnt/<disk>/file.php /<locaiton of the other file/file.php
Oh alright that makes sense. Now the question is where exactly are these php files located? Because i use the file editor on the webgui to access those webgui php files but i actually dont know their exact path. Also, just to make sure that i understand what you just said, i make a copy of the file that i just edited on my hdd (because a file on the hdd will obv never change with reboot) and have that file be copied to the location of the actual webgui file and replace it. Correct?

Re: Nas4free custom webgui

Posted: 10 Jun 2014 14:36
by b0ssman
just ssh into the machine and search for the file using the find command.
and yes to your question

Re: Nas4free custom webgui

Posted: 10 Jun 2014 14:40
by chachi420
b0ssman wrote:just ssh into the machine and search for the file using the find command.
and yes to your question
Sounds good. Ill give it a shot. Just installed the extension btw. It's dope!