-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-zero exit code when updates are available #3
Comments
Hi @issrec many thanks for your interest in this project! I've added a
Does this solve your use case? |
Hi @Marco98, $ ./routeros-upgrader -n; echo $?
2024/07/26 11:35:28 checking installed packages
|UP> MikroTik1: routeros-7.15.2-powerpc => routeros-7.15.3-powerpc
|UP> MikroTik1: wireless-7.15.2-powerpc => wireless-7.15.3-powerpc
|UP> MikroTik2: dude-7.15.2-arm => dude-7.15.3-arm
|UP> MikroTik2: container-7.15.2-arm => container-7.15.3-arm
|UP> MikroTik2: routeros-7.15.2-arm => routeros-7.15.3-arm
|UP> MikroTik2: wireless-7.15.2-arm => wireless-7.15.3-arm
2 $ echo N |./routeros-upgrader; echo $?
2024/07/26 11:37:55 checking installed packages
|UP> MikroTik1: routeros-7.15.2-powerpc => routeros-7.15.3-powerpc
|UP> MikroTik1: wireless-7.15.2-powerpc => wireless-7.15.3-powerpc
|UP> MikroTik2: dude-7.15.2-arm => dude-7.15.3-arm
|UP> MikroTik2: container-7.15.2-arm => container-7.15.3-arm
|UP> MikroTik2: routeros-7.15.2-arm => routeros-7.15.3-arm
|UP> MikroTik2: wireless-7.15.2-arm => wireless-7.15.3-arm
Install? [y/N]: 2 A small digression. $ ./routeros-upgrader -n; echo $?
2024/07/26 11:34:54 checking installed packages
|DN> MikroTik1: unreachable
|DN> MikroTik2: unreachable
2024/07/26 11:34:54 no action required - exiting
0 |
Hi @issrec, |
Hi @Marco98, $ ./routeros-upgrader -n; echo $?
2024/07/29 07:37:47 checking installed packages
|DN> MikroTik1: unreachable
|DN> MikroTik2: unreachable
2024/07/29 07:37:47 no action required - exiting
2024/07/29 07:37:47 fatal error: one or more routers unreachable
1 $ ./routeros-upgrader -n; echo $?
2024/07/29 07:38:39 checking installed packages
|DN> MikroTik1: unreachable
|UP> MikroTik2: dude-7.15.2-arm => dude-7.15.3-arm
|UP> MikroTik2: container-7.15.2-arm => container-7.15.3-arm
|UP> MikroTik2: routeros-7.15.2-arm => routeros-7.15.3-arm
|UP> MikroTik2: wireless-7.15.2-arm => wireless-7.15.3-arm
2 |
@issrec thank you! |
Overall it's OK and that's enough for my automation. $ ./routeros-upgrader -n; echo $?
2024/07/26 11:35:28 checking installed packages
|UP> MikroTik1: routeros-7.15.2-powerpc => routeros-7.15.3-powerpc
|UP> MikroTik1: wireless-7.15.2-powerpc => wireless-7.15.3-powerpc
|UP> MikroTik2: dude-7.15.2-arm => dude-7.15.3-arm
|UP> MikroTik2: container-7.15.2-arm => container-7.15.3-arm
|UP> MikroTik2: routeros-7.15.2-arm => routeros-7.15.3-arm
|UP> MikroTik2: wireless-7.15.2-arm => wireless-7.15.3-arm
2 $ ./routeros-upgrader -n; echo $?
2024/07/29 07:38:39 checking installed packages
|DN> MikroTik1: unreachable
|UP> MikroTik2: dude-7.15.2-arm => dude-7.15.3-arm
|UP> MikroTik2: container-7.15.2-arm => container-7.15.3-arm
|UP> MikroTik2: routeros-7.15.2-arm => routeros-7.15.3-arm
|UP> MikroTik2: wireless-7.15.2-arm => wireless-7.15.3-arm
2 I thank you @Marco98 for the changes you made. |
Hi, I did three sessions with the
routeros-upgrader
tool:If the tool returned a non-zero exit code when updates were available, it could be used to monitor/automate mass upgrade.
However, it would be worth taking care of standard input processing ;) and perhaps introducing the
-n
(force no) option.The text was updated successfully, but these errors were encountered: