Ubuntu Script: do this, reboot, do thatHow to install multiple PPAs and applications at once?Script/tool to clone a ubuntu serverWhich download manager is capable of 'throttle' and 'pause & resume' a running instance of download from a scriptHow to create (via installer script) a task that will install my bash script so it runs on DE startup?Script that will reboot PC on specific GPU tempUbuntu 14.04 randomly freezes after long periods and fails to reboot automatically (crontab)Server hangs on reboot when clam is running

Exponent like 2^3 in SI

Match multiple(3+) occurrences of each character

Reimbursed more than my travel expenses for interview

Which TOS episode is that gif of Spock turning around and raising eyebrow from?

Why did Bayer lose aspirin and heroin trademarks under the 1919 Treaty of Versailles?

Why don't all States switch to all postal voting?

Monthly budget screen - need to take into account whether it's early/late in the month

How am I ever going to be able to "vet" 120,000+ lines of Composer PHP code not written by me?

Is it possible for nature to create bubble wrap?

Besides TGV train, how can I travel around France from Paris area during a strike?

What specifically can swap do that RAM can't

Is it okay to true (align) a wheel with a missing spoke?

Black screen for 1-2 seconds while alt-tabbing a fullscreen game or using a Windows key

Synergistic walls: How would they interact?

What is the mathematical formula for proficiency bonus vs level/CR?

Is it possible for a tiger's tail to be taken off and replaced with a living cobra, with both creatures still alive?

Key takeaways in German in a presentation

Will iptables rules continue to work if an interface has been deleted and created again?

What would be the difference between dual-wielding a rapier and dagger vs. two shortswords?

Is using Swiss Francs (CHF) cheaper than Euros (EUR) in Switzerland?

Who created Avada Kedavra?

What's the difference between xxxx-client and xxxx-server packages?

Sleep for 1000 years

How to say No to idea given by team member, when I know from my experience that it is going to fail?



Ubuntu Script: do this, reboot, do that


How to install multiple PPAs and applications at once?Script/tool to clone a ubuntu serverWhich download manager is capable of 'throttle' and 'pause & resume' a running instance of download from a scriptHow to create (via installer script) a task that will install my bash script so it runs on DE startup?Script that will reboot PC on specific GPU tempUbuntu 14.04 randomly freezes after long periods and fails to reboot automatically (crontab)Server hangs on reboot when clam is running






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2


















I'm trying to automate some little installation process:



  • List item

  • apt install this

  • reboot

  • apt install that

  • finish some other thing

Is there a way to get a script resumed after a reboot
OR
some sort of desired state configuration



which lets me achieve that (without using any sort of server/cloud)?



Thanks



Thomas










share|improve this question































    2


















    I'm trying to automate some little installation process:



    • List item

    • apt install this

    • reboot

    • apt install that

    • finish some other thing

    Is there a way to get a script resumed after a reboot
    OR
    some sort of desired state configuration



    which lets me achieve that (without using any sort of server/cloud)?



    Thanks



    Thomas










    share|improve this question



























      2













      2









      2








      I'm trying to automate some little installation process:



      • List item

      • apt install this

      • reboot

      • apt install that

      • finish some other thing

      Is there a way to get a script resumed after a reboot
      OR
      some sort of desired state configuration



      which lets me achieve that (without using any sort of server/cloud)?



      Thanks



      Thomas










      share|improve this question














      I'm trying to automate some little installation process:



      • List item

      • apt install this

      • reboot

      • apt install that

      • finish some other thing

      Is there a way to get a script resumed after a reboot
      OR
      some sort of desired state configuration



      which lets me achieve that (without using any sort of server/cloud)?



      Thanks



      Thomas







      scripts reboot






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 30 at 8:36









      Thomas SchläppiThomas Schläppi

      462 bronze badges




      462 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          1



















          First, add a line to /etc/rc.local:



          /path/to/finishinstallscript


          Your /path/to/startinstallscript looks like this:



          #!/bin/bash
          list item
          apt install this
          reboot


          Your /path/to/finishinstallscript looks like this:



          #!/bin/bash
          apt install that
          finish some other thing
          echo "#!/bin/bash" > /path/to/finishinstallscript
          exit 0


          At reboot, the finishinstallscript is overwritten by an empty (well, just the shebang) line. Thus, after a second reboot, nothing is executed a second time. You will want to keep a copy of the original finishinstallscript, as it is lost after reboot.



          The exit 0 command is there to ensure the startup script ends properly (otherwise your system won't boot in case of failure).



          Don't forget to make both scripts executable. It could also be useful to notify the user of what is happening with a notify-send message before rebooting.






          share|improve this answer




























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177615%2fubuntu-script-do-this-reboot-do-that%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown


























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1



















            First, add a line to /etc/rc.local:



            /path/to/finishinstallscript


            Your /path/to/startinstallscript looks like this:



            #!/bin/bash
            list item
            apt install this
            reboot


            Your /path/to/finishinstallscript looks like this:



            #!/bin/bash
            apt install that
            finish some other thing
            echo "#!/bin/bash" > /path/to/finishinstallscript
            exit 0


            At reboot, the finishinstallscript is overwritten by an empty (well, just the shebang) line. Thus, after a second reboot, nothing is executed a second time. You will want to keep a copy of the original finishinstallscript, as it is lost after reboot.



            The exit 0 command is there to ensure the startup script ends properly (otherwise your system won't boot in case of failure).



            Don't forget to make both scripts executable. It could also be useful to notify the user of what is happening with a notify-send message before rebooting.






            share|improve this answer































              1



















              First, add a line to /etc/rc.local:



              /path/to/finishinstallscript


              Your /path/to/startinstallscript looks like this:



              #!/bin/bash
              list item
              apt install this
              reboot


              Your /path/to/finishinstallscript looks like this:



              #!/bin/bash
              apt install that
              finish some other thing
              echo "#!/bin/bash" > /path/to/finishinstallscript
              exit 0


              At reboot, the finishinstallscript is overwritten by an empty (well, just the shebang) line. Thus, after a second reboot, nothing is executed a second time. You will want to keep a copy of the original finishinstallscript, as it is lost after reboot.



              The exit 0 command is there to ensure the startup script ends properly (otherwise your system won't boot in case of failure).



              Don't forget to make both scripts executable. It could also be useful to notify the user of what is happening with a notify-send message before rebooting.






              share|improve this answer





























                1















                1











                1









                First, add a line to /etc/rc.local:



                /path/to/finishinstallscript


                Your /path/to/startinstallscript looks like this:



                #!/bin/bash
                list item
                apt install this
                reboot


                Your /path/to/finishinstallscript looks like this:



                #!/bin/bash
                apt install that
                finish some other thing
                echo "#!/bin/bash" > /path/to/finishinstallscript
                exit 0


                At reboot, the finishinstallscript is overwritten by an empty (well, just the shebang) line. Thus, after a second reboot, nothing is executed a second time. You will want to keep a copy of the original finishinstallscript, as it is lost after reboot.



                The exit 0 command is there to ensure the startup script ends properly (otherwise your system won't boot in case of failure).



                Don't forget to make both scripts executable. It could also be useful to notify the user of what is happening with a notify-send message before rebooting.






                share|improve this answer
















                First, add a line to /etc/rc.local:



                /path/to/finishinstallscript


                Your /path/to/startinstallscript looks like this:



                #!/bin/bash
                list item
                apt install this
                reboot


                Your /path/to/finishinstallscript looks like this:



                #!/bin/bash
                apt install that
                finish some other thing
                echo "#!/bin/bash" > /path/to/finishinstallscript
                exit 0


                At reboot, the finishinstallscript is overwritten by an empty (well, just the shebang) line. Thus, after a second reboot, nothing is executed a second time. You will want to keep a copy of the original finishinstallscript, as it is lost after reboot.



                The exit 0 command is there to ensure the startup script ends properly (otherwise your system won't boot in case of failure).



                Don't forget to make both scripts executable. It could also be useful to notify the user of what is happening with a notify-send message before rebooting.







                share|improve this answer















                share|improve this answer




                share|improve this answer








                edited Sep 30 at 9:33

























                answered Sep 30 at 9:19









                JosJos

                16.3k5 gold badges46 silver badges57 bronze badges




                16.3k5 gold badges46 silver badges57 bronze badges































                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177615%2fubuntu-script-do-this-reboot-do-that%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown









                    Popular posts from this blog

                    Tamil (spriik) Luke uk diar | Nawigatjuun

                    Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                    Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?