+ SEARCH=python3 + FOUND= + INSTALLED= + CONFIG_FILE=/etc/myDevices/AppSettings.ini + args=("$@") + reboot_args='-code dam7lfusiz -v' + ELEMENTS=3 + declare -a ASK_TO_REBOOT + ASK_TO_REBOOT=0 + VERSION=1.0.0.20822 + TARGET_KEY=Version + UPDATE=0 + INVITECODE= + NETWORK_SETTINGS=live_network.ini + ENV=live + nonverbose=-ne + nonverboseend='\r' + installpath=/etc/myDevices + uninstallpath=/etc/myDevices/uninstall + SERVER=https://cayenne.mydevices.com + UPDATE_OBJECT=/js/angular/raspberrypi/md_install_progress + DIR=/home/pi/TCC/myDevices-1.0 + cd /home/pi/TCC/myDevices-1.0 + declare echoLog=silentEcho + export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + (( i=0 )) + (( i<3 )) + '[' -code == -code ']' + (( i++ )) + INVITECODE=dam7lfusiz + '[' dam7lfusiz == -update ']' + '[' dam7lfusiz == -dev ']' + '[' dam7lfusiz == -stg ']' + '[' dam7lfusiz == -qa2 ']' + '[' dam7lfusiz == -qa1 ']' + '[' dam7lfusiz == -preprod ']' + (( i++ )) + (( i<3 )) + '[' -v == -code ']' + '[' -v == -update ']' + '[' -v == -dev ']' + '[' -v == -stg ']' + '[' -v == -qa2 ']' + '[' -v == -qa1 ']' + '[' -v == -preprod ']' + (( i++ )) + (( i<3 )) + [[ 3 > 0 ]] + case "$1" in + shift + [[ 2 > 0 ]] + case "$1" in + shift + [[ 1 > 0 ]] + case "$1" in + echoLog=normalEcho + nonverbose= + nonverboseend= + shift + [[ 0 > 0 ]] + updateProgress 0 0 'Installing myDevices agent' + echo '(0%)' + '[' -n 'Installing myDevices agent' ']' + normalEcho 'Installing myDevices agent' ++ date + echo 'Mon 17 Apr 11:14:24 BRT 2017 Installing myDevices agent' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=0&step=0' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + reboot_script=/home/pi/TCC/myDevices-1.0/reboot_install.sh + reboot_installer='/home/pi/TCC/myDevices-1.0/reboot_install.sh -code dam7lfusiz -v' ++ head -2 ++ df -k ++ tail -1 ++ awk '{print $4}' + availableSize=1801516 + '[' 1801516 -lt 200000 ']' + expandFileSystem + local retVal=0 ++ parted /dev/mmcblk0 unit % print free ++ grep 'Free Space' ++ awk '{print $2}' + freespace=0.05% + for i in '$freespace' + '[' 0.05% = 100% ']' + echo 0 + '[' -f /home/pi/TCC/myDevices-1.0/reboot_install.sh ']' ++ grep -v '@reboot /home/pi/TCC/myDevices-1.0/reboot_install.sh' ++ crontab - ++ crontab -l + out= + '[' dam7lfusiz == '' ']' + '[' 0 == 0 ']' /home/pi/TCC/myDevices-1.0/setup.sh: line 261: /etc/myDevices/AppSettings.ini: No such file or directory + touch /etc/myDevices/AppSettings.ini + cat + python= + for py in '$SEARCH' + program=/usr/bin/python3 + '[' -x /usr/bin/python3 ']' + FOUND=' python3' ++ python3 -V + version='Python 3.6.1' ++ python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())' + include=/usr/local/include/python3.6m + normalEcho 'Found Python 3.6.1... ' ++ date + echo 'Mon 17 Apr 11:14:40 BRT 2017 Found Python 3.6.1... ' + python=python3 + updateProgress 50 2 'Copying agent libraries' + echo '(50%)' + '[' -n 'Copying agent libraries' ']' + normalEcho 'Copying agent libraries' ++ date + echo 'Mon 17 Apr 11:14:40 BRT 2017 Copying agent libraries' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=50&step=2' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + updateProgress 55 3 'Installing python utils' + echo '(55%)' + '[' -n 'Installing python utils' ']' + normalEcho 'Installing python utils' ++ date + echo 'Mon 17 Apr 11:14:45 BRT 2017 Installing python utils' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=55&step=3' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + updateProgress 60 3 'Installing software components' + echo '(60%)' + '[' -n 'Installing software components' ']' + normalEcho 'Installing software components' ++ date + echo 'Mon 17 Apr 11:19:03 BRT 2017 Installing software components' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=60&step=3' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + cd python + '[' -f /usr/local/include/python3.6m/Python.h ']' + normalEcho 'Trying to install myDevices for python3 version: Python 3.6.1' ++ date + echo 'Mon 17 Apr 11:19:05 BRT 2017 Trying to install myDevices for python3 version: Python 3.6.1' + python3 setup.py install --force --record /etc/myDevices/uninstall/installed_agent zip_safe flag not set; analyzing archive contents... myDevices.utils.__pycache__.logger.cpython-36: module MAY be using inspect.getouterframes + '[' 0 -ne 0 ']' + normalEcho 'myDevices installed for Python 3.6.1\n' ++ date + echo 'Mon 17 Apr 11:19:31 BRT 2017 myDevices installed for Python 3.6.1\n' + INSTALLED=' python3' + normalEcho 'Finished agent code' ++ date + echo 'Mon 17 Apr 11:19:31 BRT 2017 Finished agent code' + cd .. + '[' -z ' python3' ']' + updateProgress 75 4 'Installing drivers' + echo '(75%)' + '[' -n 'Installing drivers' ']' + normalEcho 'Installing drivers' ++ date + echo 'Mon 17 Apr 11:19:31 BRT 2017 Installing drivers' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=75&step=4' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + grep -Fq webiopi + service --status-all + bash scripts/webiopisetup.sh --2017-04-17 11:19:55-- http://updates.mydevices.com/raspberry/webiopi.tar.gz Resolving updates.mydevices.com (updates.mydevices.com)... 54.148.225.117 Connecting to updates.mydevices.com (updates.mydevices.com)|54.148.225.117|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 129301 (126K) [application/x-gzip] Saving to: ‘/tmp/webiopi.tar.gz’ 0K .......... .......... .......... .......... .......... 39% 116K 1s 50K .......... .......... .......... .......... .......... 79% 116K 0s 100K .......... .......... ...... 100% 125K=1.1s 2017-04-17 11:19:57 (118 KB/s) - ‘/tmp/webiopi.tar.gz’ saved [129301/129301] native/gpio.c: In function ‘setup’: native/gpio.c:90:5: warning: implicit declaration of function ‘number_of_cores’ [-Wimplicit-function-declaration] if (get_rpi_revision() <= 2 || number_of_cores() <= 2) ^ native/cpuinfo.c: In function ‘get_cpuinfo_revision’: native/cpuinfo.c:38:7: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer, sizeof(buffer) , fp); ^ zip_safe flag not set; analyzing archive contents... native/gpio.c: In function ‘setup’: native/gpio.c:90:5: warning: implicit declaration of function ‘number_of_cores’ [-Wimplicit-function-declaration] if (get_rpi_revision() <= 2 || number_of_cores() <= 2) ^ zip_safe flag not set; analyzing archive contents... _webiopi.__pycache__.GPIO.cpython-36: module references __file__ Synchronizing state for webiopi.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d webiopi defaults insserv: warning: current start runlevel(s) (empty) of script `webiopi' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `webiopi' overrides LSB defaults (0 1 6). Executing /usr/sbin/update-rc.d webiopi enable sh: 0: getcwd() failed: No such file or directory + updateProgress 98 4 'Configuring os and agent' + echo '(98%)' + '[' -n 'Configuring os and agent' ']' + normalEcho 'Configuring os and agent' ++ date + echo 'Mon 17 Apr 11:21:13 BRT 2017 Configuring os and agent' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=98&step=4' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + '[' 0 == 1 ']' + updateProgress 100 6 'Install finished' + echo '(100%)' + '[' -n 'Install finished' ']' + normalEcho 'Install finished' ++ date + echo 'Mon 17 Apr 11:21:23 BRT 2017 Install finished' + '[' -n dam7lfusiz ']' + '[' 0 == 0 ']' + sudo nohup curl --data 'invitecode=dam7lfusiz&progress=100&step=6' https://cayenne.mydevices.com/js/angular/raspberrypi/md_install_progress + rm -rf /home/pi/TCC/myDevices-1.0 + rm -rf /home/pi/TCC/myDevices-1.0.tar.gz + '[' 1 -eq 1 ']' + '[' 0 -eq 0 ']' + echo 'Your system will reboot!' + sudo reboot