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?

                    Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?