[DiscordArchive] How about this ?
[DiscordArchive] How about this ?
Archived author: Tanados • Posted: 2022-05-17T21:34:47.153000+00:00
Original source
How about this ?
Did I need to shutdown server before upgrading it ?
update.txt
Archived author: Tanados • Posted: 2022-05-17T21:35:54.336000+00:00
Original source
Ty mate it work like charm
Archived author: Revision • Posted: 2022-05-17T21:44:30.069000+00:00
Original source
You need to shut the server down for `make install`, yes. Running cmake and make before that can be done while the server is running.
Archived author: Ruderalis • Posted: 2022-05-17T22:26:09.170000+00:00
Original source
You can actually `make install` then restart the server only at the end of compilation
Archived author: Revision • Posted: 2022-05-17T22:30:52.694000+00:00
Original source
You run `make -j $(nproc)`, let it finish, stop the server and run `make install` to copy the compiled binaries to the bin folder and start the server back up.
Archived author: Revision • Posted: 2022-05-17T22:32:15.387000+00:00
Original source
That is if you have a slow system or need the server back up as soon as possible, for whatever reason.
Archived author: Revision • Posted: 2022-05-17T22:36:32.896000+00:00
Original source
Also, you shouldn't use `while :; do` for that. It's called a forever loop, which wouldn't work in your case.
Archived author: Revision • Posted: 2022-05-17T22:39:35.428000+00:00
Original source
If there are issues that occur that causes an error, looping it over and over wouldn't be the best way to go. It would just spam the same error over and over again. Errors don't magically fix themselves.
I would suggest adding the following after each command to terminate the script on errors instead, letting you handle the issue before trying again.
```
if [[ $? -ne 0 ]]; then
exit $?
fi
```
Archived author: Tanados • Posted: 2022-05-17T22:46:34.449000+00:00
Original source
Sometthing like this?
can i add echo within if ?
new_10.txt
Archived author: Revision • Posted: 2022-05-17T22:48:32.742000+00:00
Original source
You should remove all the while loops.
An example of a set of commands, used in my script, would look like this:
```
# Go into the source folder to update it
cd $OPTION_SOURCE_LOCATION
# Fetch all available updates
git fetch --all
# Check to make sure there weren't any errors
if [[ $? -ne 0 ]]; then
# Terminate script on errors
exit $?
fi
# Reset the source code, removing all local changes
git reset --hard origin/master
# Check to make sure there weren't any errors
if [[ $? -ne 0 ]]; then
# Terminate script on errors
exit $?
fi
```