= 4) then local stat = os.execute("umount " .. split1[4]) local stat = os.execute("rm -f " .. "/var/usb1Info") local usbStatusFile = db.getAttribute("environment", "name", "USB_STATUS_FILE1", "value") if (usbStatusFile ~= nil) then util.appendDebugOut("Exec = " .. os.execute("echo 0 > " .. usbStatusFile)) end else statusMessage = "Unmout Failed" end else statusMessage = "Unmout Failed" end web.goToPage(NextPage, true, true) elseif (ButtonType and ButtonType == "unmount2") then local usb2Status = "" -- Reading file for usb 2 local fUsb2 = io.open("/var/usb2Info", "r") if(fUsb2) then usb2Status = fUsb2:read("*all") or '' fUsb2:close() end if(usb2Status ~= "") then local split1 = util.split(usb2Status,":") if (#split1 >= 4) then local stat = os.execute("umount " .. split1[4]) local stat = os.execute("rm -f " .. "/var/usb2Info") local usbStatusFile = db.getAttribute("environment", "name", "USB_STATUS_FILE2", "value") if (usbStatusFile ~= nil) then util.appendDebugOut("Exec = " .. os.execute("echo 0 > " .. usbStatusFile)) end else statusMessage = "Unmout Failed" end else statusMessage = "Unmout Failed" end web.goToPage(NextPage, true, true) else --[[Begin: variable Declaration --]] local USB1_STORAGE_MSG = "USB-1: Storage Device Settings"; local USB1_3G_MSG = "USB-1: 3G Device Settings"; local USB1_CONNECTED_MSG = "USB-1: Device Connected"; local USB1_NOTCONNECTED_MSG = "USB-1: Device Not Connected"; local MOUNT_MSG = "Mounted"; local NOT_MOUNT_MSG = "Device Not Mounted"; local STORAGE_ICON = "images/usbDataIcon.png"; local ICON_3G = "images/usb3gIcon.png"; local NO_USB_ICON = "images/usbNoIcon.png"; local USB2_STORAGE_MSG = "USB-2: Storage Device Settings"; local USB2_3G_MSG = "USB-2: 3G Device Settings" ; local USB2_CONNECTED_MSG = "USB-2: Device Connected"; local USB2_NOTCONNECTED_MSG = "USB-2: Device Not Connected"; local NOT_APPLICABLE_MSG = "NA" --[[End: variable Declaration --]] --Begin: Reading usbInfo1 file and usb_status1.txt local iconImageUsb1 = NO_USB_ICON local usb1heading = USB1_NOTCONNECTED_MSG local vendorUsb1 = NOT_APPLICABLE_MSG local modelUsb1 = NOT_APPLICABLE_MSG local typeUsb1 = NOT_APPLICABLE_MSG local mountUsb1 = NOT_APPLICABLE_MSG local buttonUsb1 = "" usbStatus1 = nil local usb1StatusFlag = 0 local usbStatusFile1 = db.getAttribute("environment", "name", "USB_STATUS_FILE1", "value") if (usbStatusFile1 ~= nil and util.fileExists(usbStatusFile1)) then usbStatus1 = util.fileToString(usbStatusFile1) usbStatus1 = string.gsub (usbStatus1, "\n", "") usb1StatusFlag = 1 end local fUsb1 = io.open("/var/usb1Info", "r") if(usb1StatusFlag == 1) then if(usbStatus1 == "0") then mountUsb1 = NOT_MOUNT_MSG usb1heading = USB1_CONNECTED_MSG elseif(usbStatus1 ~= "0") then if(fUsb1) then mountUsb1 = MOUNT_MSG local usb1Status = fUsb1:read("*all") or '' local splitUsb1 = util.split(usb1Status,":") if(splitUsb1 ~= nil and #splitUsb1 > 4) then vendorUsb1 = splitUsb1[1] modelUsb1 = splitUsb1[2] typeUsb1 = splitUsb1[3] if(splitUsb1[3] == "storage") then iconImageUsb1 = STORAGE_ICON usb1heading = USB1_STORAGE_MSG buttonUsb1 = '<'..'input type="submit" value="Safely Remove" name="button.unmount1.usbSettings" class="submit2" title="Safely Remove"' .. ' >' elseif(splitUsb1[3] == "3G") then iconImageUsb1 = ICON_3G usb1heading = USB1_3G_MSG end end fUsb1:close() end end end -- Reading file for usb 2 local iconImageUsb2 = NO_USB_ICON local usb2heading = USB2_NOTCONNECTED_MSG local vendorUsb2 = NOT_APPLICABLE_MSG local modelUsb2 = NOT_APPLICABLE_MSG local typeUsb2 = NOT_APPLICABLE_MSG local mountUsb2 = NOT_APPLICABLE_MSG local buttonUsb2 = "" usbStatus2 = nil local usb2StatusFlag = 0 local usbStatusFile2 = db.getAttribute("environment", "name", "USB_STATUS_FILE2", "value") if (usbStatusFile2 ~= nil and util.fileExists(usbStatusFile2)) then usbStatus2 = util.fileToString(usbStatusFile2) usbStatus2 = string.gsub (usbStatus2, "\n", "") usb2StatusFlag = 1 end local fUsb2 = io.open("/var/usb2Info", "r") if(usb2StatusFlag == 1) then if(usbStatus2 == "0") then mountUsb2 = NOT_MOUNT_MSG usb2heading = USB2_CONNECTED_MSG elseif(usbStatus2 ~= "0") then if(fUsb2) then util.appendDebugOut("HIHI") mountUsb2 = MOUNT_MSG local usb2Status = fUsb2:read("*all") or '' local splitUsb2 = util.split(usb2Status,":") if(splitUsb2 ~= nil and #splitUsb2 > 4) then vendorUsb2 = splitUsb2[1] modelUsb2 = splitUsb2[2] typeUsb2 = splitUsb2[3] if(splitUsb2[3] == "storage") then iconImageUsb2 = STORAGE_ICON usb2heading = USB2_STORAGE_MSG buttonUsb2 = '<'..'input type="submit" value="Safely Remove" name="button.unmount2.usbSettings" class="submit2" title="Safely Remove"' .. ' >' elseif(splitUsb2[3] == "3G") then iconImageUsb2 = ICON_3G usb2heading = USB2_3G_MSG end end fUsb2:close() end end end ?> $|COMPANY_NAME|$ : $|APP_NAME|$
$| statusMessage |$
USB SettingsLogout
$| initialDescription or '' |$
 
$| usb1heading |$
Device Vendor: $| vendorUsb1|$
Device Model: $| modelUsb1 |$
Device Type: $| typeUsb1 |$
Mount Status: $| mountUsb1 |$
$| buttonUsb1 |$  
 
$| usb2heading |$
Device Vendor: $| vendorUsb2|$
Device Model: $| modelUsb2 |$
Device Type: $| typeUsb2 |$
Mount Status: $| mountUsb2 |$
$| buttonUsb2 |$  
Helpful Hints...
$| helpfullHints or '' |$