Is it possible to restart a machine when provisioning a machine using Vagrant and pickup where the script left off?

后端 未结 4 2187
北荒
北荒 2021-02-12 11:47

I was reading a tutorial in bash where they said to restart the machine, there was no option to restart a service directly, it was a matter of restarting the machine, and then t

4条回答
  •  面向向阳花
    2021-02-12 12:24

    I've never done this, but if I had to I would split the script into two pieces, one before restart that includes the restart command, then another that's post install.

    The first one would also create a lock file.

    The overall script would run the first script if the lock file didn't exist or run the second one if the file exists. This overall script would be set up for startup.

提交回复
热议问题