On Sat, Oct 08, 2022 at 11:14:34AM +0000, Mikolaj Kucharski wrote: > On Sat, Oct 08, 2022 at 09:57:54AM +0000, Klemens Nanni wrote: > > On Sat, Oct 08, 2022 at 07:33:38AM +0200, Florian Obser wrote: > > > Being up2date doesn't feel like an error to me, what am I missing? > > > > I concur. > > > > I think Josh is looking for similar behaviour to syspatch(8). To be able > to distinguish, upgrade is ready (exit 0), system is up to date (exit 2) > or error occurred (exit 1). > > I have the same need to distinguish between nothing to do - you are on > latest snapshot (sysupgrade -s -n) versus pending upgrade, as I use > `sysupgrade -s -n` a lot. Yes, a non-zero exit allows for:
/usr/sbin/sysupgrade -s -n || exit > On my side I just check that non-zero /bsd.upgrade file exists. I > think what Josh is trying to achieve make sense, but I would make it > exit code 2, the same way like syspatch(8). That would also work. Thanks, Mikolaj!