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;
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
add a comment
|
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
add a comment
|
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
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
scripts reboot
asked Sep 30 at 8:36
Thomas SchläppiThomas Schläppi
462 bronze badges
462 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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.
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment
|
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.
add a comment
|
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.
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.
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
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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