• April 16, 2024, 03:27:52 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Startup script  (Read 2194 times)

ThePloum

  • Level 1 Member
  • *
  • Posts: 4
Startup script
« on: January 10, 2017, 09:16:46 PM »

Hello,

I would like to run a sh script at startup but I can't find a solution!
I tried to make change in: /etc/inittab, /etc/rc.sh, /usr/sbin/system_init. At best I can save changes but everything is lost when I reboot!
Do you know if there is a file I could create or modify to run my script at startup?

Thanks for your help!

Gilles
Logged

vtverdohleb

  • Level 5 Member
  • *****
  • Posts: 712
    • Add-Ons for D-Link NAS
Re: Startup script
« Reply #1 on: January 11, 2017, 11:13:08 AM »

You consider NAS as a personal computer with Linux. This is not true. No standard startup script.
Rather it is, but if it is to admit the slightest mistake - NAS become a not working stuff ...
It can be relatively painless, the commands/scripts append any "init.sh" from the catalog of add-ons /mnt/HD/HD_a2/Nas_Prog/*
In an extreme case, if something goes wrong, you can format the HDD. NAS itself is not affected.
Logged
Add-on Application questions and issues, please include the following minimal information in your post:
* ShareCenter Model
* Add-on Name
* Add-on Version
* Detailed Description of your Issue
Donate: http://dlink.vtverdohleb.org.ua/Add-On/donate.php

ThePloum

  • Level 1 Member
  • *
  • Posts: 4
Re: Startup script
« Reply #2 on: January 11, 2017, 06:10:20 PM »

Hi,

I do not compare a NAS to a personal computer, but AS A BEGINER I just try to simplify some things with a little script.
Your recommandation is to create an add-on just to run a script at startup. You'r right it could be a complete solution with statup and shutdown.
My need is a lot more simple, just run a script to register typical stuff like alias, environment variables and so on!  :)
It could be usefull to have a convention like: place a script named "startup.sh" at the root of your first volume to personalize your environment. It's just a suggestion for an intermediate solution between Add-on, FFP or Alt-F for a really simple need.

Thanks for your help!
« Last Edit: January 11, 2017, 06:11:55 PM by ThePloum »
Logged