Skip to content

syntax error: invalid arithmetic operator in check-updates.sh #265

@BadFlo

Description

@BadFlo

Describe the bug
When the script is doing the last checks for

To Reproduce
Steps to reproduce the behavior:

  1. Have a qemu VM without ssh configured
  2. update
  3. See error

Debug output

++ qm guest exec 815 -- bash -c '[ -f /var/run/reboot-required.pkgs ]'
++ grep exitcode
+ [[    "exitcode" : 1, =~ 0 ]]
+ [[ 0"
" :  -gt 0 ]]
/etc/ultimate-updater/check-updates.sh: line 376: [[: 0"
" : : syntax error: invalid arithmetic operator (error token is ""
" : ")
+ [[ 0"
" :  -gt 0 ]]
/etc/ultimate-updater/check-updates.sh: line 376: [[: 0"
" : : syntax error: invalid arithmetic operator (error token is ""
" : ")
+ [[ '' == true ]]
+ [[ '' == true ]]
+ [[ 0"
" :  -gt 0 ]]
/etc/ultimate-updater/check-updates.sh: line 380: [[: 0"
" : : syntax error: invalid arithmetic operator (error token is ""
" : ")
+ [[ 0"
" :  -gt 0 ]]
/etc/ultimate-updater/check-updates.sh: line 382: [[: 0"
" : : syntax error: invalid arithmetic operator (error token is ""
" : ")
+ [[ 0"
" :  -gt 0 ]]
/etc/ultimate-updater/check-updates.sh: line 384: [[: 0"
" : : syntax error: invalid arithmetic operator (error token is ""
" : ")
+ shift

Expected behavior
No error.

Screenshots
If applicable, add screenshots to help explain your problem.

VM/LXC (please complete the following information):

  • OS: Debian
  • Version 13

Used Version

  Extras:  2.2
  Config:  1.8.8
  Welcome: 1.9
  Check:   1.7.9

Additional context
When running the commands by hand, there is an issue.

root@pv1:~# qm guest exec "$VM" -- bash -c "apt-get -s upgrade | grep -ci ^inst.*security | tr -d '\n'" | tail -n +4 | head -n -1 | cut -c 18- | rev | cut -c 2- | rev
0"
" :
root@pv1:~# qm guest exec "$VM" -- bash -c "apt-get -s upgrade | grep -ci ^inst.*security | tr -d '\n'"
{
   "exitcode" : 0,
   "exited" : 1,
   "out-data" : "0",
   "out-truncated" : 0
}
root@pv1:~# qm guest exec "$VM" -- bash -c "apt-get -s upgrade | tr -d '\n'"
{
   "exitcode" : 0,
   "exited" : 1,
   "out-data" : "Reading package lists...Building dependency tree...Reading state information...Calculating upgrade...0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.",
   "out-truncated" : 0
}

Metadata

Metadata

Assignees

Labels

betaIn beta stadiumbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions