Want to subscribe to topics you're interested in?
Become a Member

Upgrade centmin.sh error

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Tracy Perry, Jun 30, 2016.

  1. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    11:04 PM
    1.21.6
    MariaDB 10.3.36
    @eva2000 , was upgrading a VPS (running on ProxMox) for TJA (thejack.army) and when I run the centmin.sh script I got this
    Code:
    inc/cpcheck.inc: line 348: [[: 24%: syntax error: operand expected (error token is "%")
    /etc/init.d /usr/local/src/centminmod
    /usr/local/src/centminmod
    
    This was after pulling the latest BETA code in for his centmin install.

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,190
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    2:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    centos 7 or 6 ?

    what's output for these 2 commands where first 1 is triggered for centos 7 and 2nd for centos 6
    Code (Text):
    df --output=avail /var | tail -1

    Code (Text):
    df /var | tail -1 | awk '{print $4}'

    and
    Code (Text):
    df /var
     
    Last edited: Jun 30, 2016
  3. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    11:04 PM
    1.21.6
    MariaDB 10.3.36
    On the second VPS I am getting this
    Code:
    inc/cpcheck.inc: line 348: [[: 18%: syntax error: operand expected (error token is "%")
    inc/cpcheck.inc: line 392: [[: 18%: syntax error: operand expected (error token is "%")
    /etc/init.d /usr/local/src/centminmod
    /usr/local/src/centminmod
    I have a feeling it has to do with the VPS.

    EDIT: I'll pull that info in just a minute.. doing a PHP upgrade.
     
  4. Tracy Perry

    Tracy Perry Active Member

    280
    118
    43
    Aug 24, 2014
    Texas
    Ratings:
    +210
    Local Time:
    11:04 PM
    1.21.6
    MariaDB 10.3.36
    For the second VPS (with the errors)
    First command
    Code:
    root@shagme centminmod]# df --output=avail /var | tail -1
    df: unrecognized option '--output=avail'
    Try `df --help' for more information.
    Second Command
    Code:
    root@shagme centminmod]# df /var | tail -1 | awk '{print $4}'
    19%
    Third command
    Code:
    root@shagme centminmod]# df /var
    Filesystem           1K-blocks    Used Available Use% Mounted on
    /dev/mapper/vg_shagme-lv_root
                          51475068 8837056  40016572  19% /
    Plain df
    Code:
    [root@shagme centminmod]# df
    Filesystem           1K-blocks     Used Available Use% Mounted on
    /dev/mapper/vg_shagme-lv_root
                          51475068  8837060  40016568  19% /
    tmpfs                  2996368        0   2996368   0% /dev/shm
    /dev/vda1               487652   137360    324692  30% /boot
    /dev/mapper/vg_shagme-lv_home
                         251358996  5087508 233496476   3% /home
    /home/usertmp_donotdelete
                           3871532     7908   3663624   1% /tmp
    ftpback-rbx6-38.ovh.net:/export/ftpbackup/ns3357957.ip-37-187-57.eu
                         104857600 24080384  80777216  23% /storage
    For the first VPS (first message)
    Code:
    [root@adk tracy]# df --output=avail /var | tail -1
    df: unrecognized option '--output=avail'
    Try `df --help' for more information.
    [root@adk tracy]# df /var | tail -1 | awk '{print $4}'
    24%
    [root@adk tracy]# df /var
    Filesystem           1K-blocks     Used Available Use% Mounted on
    /dev/mapper/vg_playball-lv_root
                          51475068 11562628  37291000  24% /
    [root@adk tracy]# df
    Filesystem           1K-blocks     Used Available Use% Mounted on
    /dev/mapper/vg_playball-lv_root
                          51475068 11562628  37291000  24% /
    tmpfs                  6098956        0   6098956   0% /dev/shm
    /dev/vda1               487652   137247    324805  30% /boot
    /dev/mapper/vg_playball-lv_home
                         457744624  6863404 427622496   2% /home
    tmpfs                  2058252    72372   1985880   4% /tmp
    ftpback-rbx6-38.ovh.net:/export/ftpbackup/ns3357957.ip-37-187-57.eu
                         104857600 24080384  80777216  23% /storage
    He's running CentOS 6.8
    Code:
    root@adk tracy]# rpm --query centos-release
    centos-release-6-8.el6.centos.12.3.x86_64
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,190
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    2:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    problem is the column position
    Code (Text):
    df /var | tail -1 | awk '{print $4}'
    19%

    due to the device label/name being so long it pushed the columns to a second row so instead of 4th column being available disk space in bytes, it is now 3rd column. Will fix it by end of the day :)

    simple fix is output in POSIX output format instead
    Code (Text):
    df -P /var | tail -1 | awk '{print $4}'
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,190
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    2:04 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+