Modified replace_symbols to only replace PAD_SERIAL and PHONE_SERIAL if there are devices connected to the machine. Also the function now takes two optional paramters device_serial and device_endpoint which can be set to the corresponding shell variables.