Automatic startup script with user interaction

2 posts / 0 new
Last post
#1 Sun, 2017-12-03 22:50
Profia
  • Profia's picture
  • Offline
  • Last seen: 1 week 3 days ago
  • Joined: 2017-12-03

Hi,
I have a script and I need this script to be run on startup.
The script must be run automatically in defaut console withou login prompt.
However during the run it displays some info and requires user input.
Could you please advise me how to configure the system to run the script in the way I described above ?
Thank you.

Mon, 2017-12-04 00:14
Profia
  • Profia's picture
  • Offline
  • Last seen: 1 week 3 days ago
  • Joined: 2017-12-03

After some investigation I found a working solution.
in /etc/inittab
I modified the line

tty1::respawn:/sbin/getty 38400 tty1

to

tty1::once:/bin/sh /etc/scripts/myscript.sh

to keep the shell after the script finishes I put
/bin/sh
to the end of the script

Log in or register to post comments