I have been creating an install script that is going to be used for installing proxy and Dev configs on Ubuntu Xenial Desktop only.
I have 2 scripts that are all interactive and require input from the user, my challenge is each script needs a reboot after it is installed and then needs to automatically open another console and become interactive with the next script.
here is a diagram of the flow:
script_1.sh > reboot > script_2.sh
V V
usr input usr input
required required
I have all the scripts completed and working as they should my challenge is trying to configure Systemd so after the reboot it will open a console and begin the next script.
I am new to this but I built something using rc.local then read the magnitude of posts saying it's not good practice to use it for these sorts of installations, I started using upstart then I found out that it is deprecated and I am required to use Systemd.
Obviously, I would have these scripts built and just copy them in and delete them out when done during the process, here is an attempt earlier any help on how to do this would be fantastic as I have lost 2 days this.
previous atempt:
description "install script"
start on local-filesystems or runlevel [2345]
stop on runlevel [!2345]
pre-start script
# prepare environment
touch /var/logs/DID.log
exec echo DID installation started `date` >> /var/log/DID.log
end script
script
# do some stuff
exec ~/Documents/script_2.sh
console output
end script
post-stop script
# clean up
exec echo DID stage 2 installation finished `date` >> /var/log/DID.log
end script
Cheers in advance for any help you can provide.
are all interactive and require input from the user,I don't think this is the write way to do things. Instead you should use config files and make those startup scripts non-interactive..